Index: trunk/nv/core/logger.hh
===================================================================
--- trunk/nv/core/logger.hh	(revision 377)
+++ trunk/nv/core/logger.hh	(revision 378)
@@ -131,5 +131,5 @@
 	 * Console logger sink.
 	 *
-	 * Logs to std::out -- be sure a console window is open, or std::out redirected!
+	 * Logs to standard output -- be sure a console window is open, or output redirected!
 	 */
 	class log_console_sink : public log_sink
Index: trunk/nv/core/logging.hh
===================================================================
--- trunk/nv/core/logging.hh	(revision 377)
+++ trunk/nv/core/logging.hh	(revision 378)
@@ -82,5 +82,5 @@
 		{
 			log_append( t );
-			log_sequence( level, std::forward<Args>( args )... );
+			log_sequence( level, nv::forward<Args>( args )... );
 		}
 		virtual ~logger_base() {}
Index: trunk/nv/lua/lua_path.hh
===================================================================
--- trunk/nv/lua/lua_path.hh	(revision 377)
+++ trunk/nv/lua/lua_path.hh	(revision 378)
@@ -16,5 +16,6 @@
 #include <nv/core/common.hh>
 #include <nv/stl/string.hh>
-#include <cstring>
+#include <nv/stl/utility.hh>
+#include <nv/stl/capi.hh>
 
 struct lua_State;
@@ -32,5 +33,5 @@
 			{
 				static_assert( sizeof...( Args ) < 8, "Path can only take up to 8 arguments!" );
-				initialize( std::forward<Args>( args )... );
+				initialize( nv::forward<Args>( args )... );
 			}
 
@@ -42,5 +43,5 @@
 			void initialize( T&& arg ) 
 			{
-				push( std::forward<T>( arg ) );
+				push( nv::forward<T>( arg ) );
 				if ( m_count == 1 && m_elements[0].length ) parse();
 			}
@@ -49,6 +50,6 @@
 			void initialize( T&& arg, Args&&... args )
 			{ 
-				push( std::forward<T>( arg ) );
-				initialize( std::forward<Args>( args )... );
+				push( nv::forward<T>( arg ) );
+				initialize( nv::forward<Args>( args )... );
 			}
 
Index: trunk/nv/stl/capi.hh
===================================================================
--- trunk/nv/stl/capi.hh	(revision 377)
+++ trunk/nv/stl/capi.hh	(revision 378)
@@ -18,48 +18,103 @@
 #include <nv/core/common.hh>
 
+namespace nv
+{
+
+	namespace detail
+	{
+
 #if NV_COMPILER == NV_MSVC
-extern "C" {
-	NV_NOALIAS NV_RESTRICT void * __cdecl calloc( size_t _Count, size_t _Size );
-	NV_NOALIAS             void   __cdecl free( void * _Memory );
-	NV_NOALIAS NV_RESTRICT void * __cdecl malloc( size_t );
-	NV_NOALIAS NV_RESTRICT void * __cdecl realloc( void * _Memory, size_t _NewSize );
-}
+#define NV_CAPI_CALL(name) detail::name
+		extern "C" {
+			NV_NOALIAS NV_RESTRICT void * __cdecl calloc( size_t _Count, size_t _Size );
+			NV_NOALIAS             void   __cdecl free( void * _Memory );
+			NV_NOALIAS NV_RESTRICT void * __cdecl malloc( size_t );
+			NV_NOALIAS NV_RESTRICT void * __cdecl realloc( void * _Memory, size_t _NewSize );
+			void *  __cdecl memcpy( void * _Dst, const void * _Src, size_t _Size );
+			void *  __cdecl memmove( void * _Dst, const void * _Src, size_t _Size );
+			void *  __cdecl memset( void * _Dst, int _Val, size_t _Size );
+			void *  __cdecl memchr( const void * _Buf, int _Val, size_t _MaxCount );
+			int     __cdecl memcmp( const void * _Buf1, const void * _Buf2, size_t _Size );
+			int     __cdecl strcmp( const char * _Str1, const char * _Str2 );
+			int     __cdecl strncmp( const char * _Str1, const char * _Str2, size_t _MaxCount );
+			size_t  __cdecl strlen( const char * _Str );
+		}
 #endif 
-// TODO: remove when clang 3.5 will be used (with builtins)
+		// TODO: remove when clang 3.5 will be used (with builtins)
 #if NV_COMPILER == NV_CLANG
-extern "C" {
-	extern void * calloc( nv::size_t, nv::size_t );
-	extern void   free( void * );
-	extern void * malloc( nv::size_t );
-	extern void * realloc( void * , nv::size_t );
-}
+#define NV_CAPI_CALL(name) detail::name
+		extern "C" {
+			extern void * __cdecl calloc( nv::size_t, nv::size_t );
+			extern void   __cdecl free( void * );
+			extern void * __cdecl malloc( nv::size_t );
+			extern void * __cdecl realloc( void * , nv::size_t );
+			extern void * __cdecl memcpy( void * , const void * , nv::size_t );
+			extern void * __cdecl memmove( void * , const void * , nv::size_t );
+			extern void * __cdecl memset( void * , int , nv::size_t );
+			extern void * __cdecl memchr( const void * , int , nv::size_t );
+			extern int    __cdecl memcmp( const void * , const void * , nv::size_t  );
+			extern int    __cdecl strcmp ( const char * , const char * );
+			extern int    __cdecl strncmp( const char * , const char * , size_t );
+			extern nv::size_t __cdecl strlen ( const char * );
+	}
 #endif
 
-namespace nv
-{
+#if NV_COMPILER == NV_GNUC
+#define NV_CAPI_CALL(name) __builtin_##name
+#endif
+	}
+
 	inline void* nvmalloc( size_t size )
 	{
-#if NV_COMPILER == NV_MSVC
-		return malloc( size );
-#elif NV_COMPILER == NV_CLANG
-		return malloc( size );
-		//		return __builtin_operator_new( size );
-#else
-		return __builtin_malloc( size );
-#endif
+		return NV_CAPI_CALL(malloc)( size );
 	}
 	inline void nvfree( void* p )
 	{
-#if NV_COMPILER == NV_MSVC
-		free( p );
-#elif NV_COMPILER == NV_CLANG
-		free( p );
-		//		__builtin_operator_delete( p );
-#else
-		__builtin_free( p );
-#endif
+		NV_CAPI_CALL( free )( p );
+	}
+
+	inline void* nvmemcpy( void *dest, const void *src, size_t count )
+	{
+		return NV_CAPI_CALL( memcpy )( dest, src, count );
+	}
+
+	inline void* nvmemmove( void *dest, const void *src, size_t count )
+	{
+		return NV_CAPI_CALL( memmove )( dest, src, count );
+	}
+
+	inline void* nvmemset( void *dest, unsigned char value, size_t count )
+	{
+		return NV_CAPI_CALL( memset )( dest, (int)value, count );
+	}
+
+	inline void* nvmemchr( const void *src, unsigned char value, size_t max_count )
+	{
+		return NV_CAPI_CALL( memchr )( src, (int)value, max_count );
+	}
+
+	inline int nvmemcmp( const void * m1, const void * m2, nv::size_t max_count )
+	{
+		return NV_CAPI_CALL( memcmp )( m1, m2, max_count );
+	}
+
+	inline int nvstrcmp( const char * s1, const char * s2 )
+	{
+		return NV_CAPI_CALL( strcmp )( s1, s2 );
+	}	
+
+	inline int nvstrncmp( const char * s1, const char * s2, size_t max_count )
+	{
+		return NV_CAPI_CALL( strncmp )( s1, s2, max_count );
+	}
+
+	inline nv::size_t nvstrlen( const char * s )
+	{
+		return NV_CAPI_CALL( strlen )( s );
 	}
 
 }
 
+#undef NV_CAPI_CALL
+
 #endif // NV_STL_CAPI_HH
Index: trunk/nv/stl/cstring_store.hh
===================================================================
--- trunk/nv/stl/cstring_store.hh	(revision 377)
+++ trunk/nv/stl/cstring_store.hh	(revision 378)
@@ -16,7 +16,6 @@
 #include <nv/core/common.hh>
 #include <nv/stl/array.hh>
+#include <nv/stl/capi.hh>
 #include <unordered_map>
-#include <cstring>
-#include <cstdlib>
 
 namespace nv
@@ -28,8 +27,8 @@
 		inline char *cstring_duplicate( const char *s )
 		{
-			size_t length = std::strlen( s ) + 1;
-			void *result = std::malloc( length );
+			size_t length = nvstrlen( s ) + 1;
+			void *result = nvmalloc( length );
 			if ( result == nullptr ) return nullptr;
-			return (char *)std::memcpy( result, s, length );
+			return (char *)nvmemcpy( result, s, length );
 		}
 
@@ -38,5 +37,5 @@
 			bool operator()( const char* lhs, const char* rhs ) const
 			{
-				return strcmp( lhs, rhs ) == 0;
+				return nvstrcmp( lhs, rhs ) == 0;
 			}
 		};
Index: trunk/nv/stl/iterator.hh
===================================================================
--- trunk/nv/stl/iterator.hh	(revision 377)
+++ trunk/nv/stl/iterator.hh	(revision 378)
@@ -145,5 +145,5 @@
 	template < typename Iterator1, typename Iterator2 >
 	inline typename reverse_iterator<Iterator1>::difference_type operator-( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs )
-	{ return lhs.base() - rhs.base(); }
+	{ return rhs.base() - lhs.base(); }
 	template < typename Iterator > inline reverse_iterator<Iterator> operator+( typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& iter )
 	{ return reverse_iterator<Iterator>( iter.base() - n ); }
Index: trunk/nv/stl/singleton.hh
===================================================================
--- trunk/nv/stl/singleton.hh	(revision 377)
+++ trunk/nv/stl/singleton.hh	(revision 378)
@@ -14,5 +14,5 @@
 #define NV_CORE_SINGLETON_HH
 
-#include <cassert>
+#include <nv/core/common.hh>
 
 namespace nv
@@ -35,5 +35,5 @@
         singleton()
         {
-            assert(!singleton_);
+            NV_ASSERT(!singleton_,"Singleton already exists!");
             singleton_ = static_cast<T*>(this);
         }
@@ -44,6 +44,6 @@
         ~singleton()
         {
-            assert(singleton_);
-            singleton_ = 0;
+			NV_ASSERT( singleton_, "Singleton already destroyed!" );
+			singleton_ = nullptr;
         }
 
@@ -66,5 +66,5 @@
         static T *pointer()
         {
-            assert(singleton_);
+			NV_ASSERT( singleton_, "Singleton not valid!" );
             return singleton_;
         }
@@ -74,6 +74,6 @@
         static T &reference()
         {
-            assert(singleton_);
-            return *singleton_;
+			NV_ASSERT( singleton_, "Singleton not valid!" );
+			return *singleton_;
         }
     };
Index: trunk/nv/stl/string.hh
===================================================================
--- trunk/nv/stl/string.hh	(revision 377)
+++ trunk/nv/stl/string.hh	(revision 378)
@@ -22,7 +22,5 @@
 
 #include <string>
-#include <cstring>
 #include <sstream>
-#include <fstream>
 #include <nv/core/common.hh>
 #include <nv/stl/traits/primary.hh>
@@ -69,178 +67,7 @@
 
 	/**
-	* Utility function for converting a string to the given type
-	*
-	* @param vin the string representing the value
-	* @param vout the value to be read. Must be streamable with >>
-	* @throw runtime_error Throws runtime_error on conversion fail
-	*/
-	template < class T >
-	void from_string( const string& vin, T& vout )
-	{
-		std::istringstream value( vin );
-		value >> vout;
-
-		if ( value.fail() )
-		{
-//			NV_THROW( runtime_error, "bad cast" );
-		}
-	}
-
-	/**
-	* Utility function for converting a string to the given type
-	*
-	* @param vin the string representing the value
-	* @throw runtime_error Throws runtime_error on conversion fail
-	*/
-	template < class T >
-	T string_cast( const string& vin )
-	{
-		T vout;
-		std::istringstream value( vin );
-		value >> vout;
-
-		if ( value.fail() )
-		{
-//			NV_THROW( runtime_error, "bad cast" );
-		}
-		return vout;
-	}
-
-
-	/**
-	* Override function for special treatment of strings. Returns the
-	* value passed.
-	*/
-	inline void from_string( const string& vin, string& vout )
-	{
-		vout = vin;
-	}
-
-	/**
-	* Override function for special treatment of strings. Returns the
-	* value passed.
-	*/
-	template <>
-	inline std::string string_cast( const string& vin )
-	{
-		return vin;
-	}
-
-
-	/**
 	* Simple function for slurping a file into a string.
 	*/
-	inline std::string slurp( const std::string& filename )
-	{
-		std::ifstream input(filename);
-//		if ( !input.is_open() ) NV_THROW( std::runtime_error, "File "+filename+" not found!");
-		std::stringstream sstr;
-		while(input >> sstr.rdbuf());
-		return sstr.str();
-	}
-
-	inline bool trim( std::string& str )
-	{
-		size_t endpos = str.find_last_not_of(" \r\n\t");
-		size_t startpos = str.find_first_not_of(" \r\n\t");
-
-		if ( string::npos != endpos || string::npos != startpos )
-		{
-			if ( string::npos == startpos ) startpos = 0;
-			if ( string::npos != endpos )   endpos = endpos+1-startpos;
-			str = str.substr( startpos, endpos );
-			return true;
-		}
-		return false;
-	}
-
-	inline bool rtrim( std::string& str )
-	{
-		size_t endpos = str.find_last_not_of(" \r\n\t");
-		if ( string::npos != endpos )
-		{
-			str = str.substr( 0, endpos+1 );
-			return true;
-		}
-		return false;
-	}
-
-	inline bool ltrim( std::string& str )
-	{
-		size_t startpos = str.find_first_not_of(" \r\n\t");
-		if( string::npos != startpos )
-		{
-			str = str.substr( startpos );
-			return true;
-		}
-		return false;
-	}
-
-	inline std::string trimmed( const std::string& str )
-	{
-		size_t endpos = str.find_last_not_of(" \r\n\t");
-		size_t startpos = str.find_first_not_of(" \r\n\t");
-
-		if ( string::npos != endpos || string::npos != startpos )
-		{
-			if ( string::npos == startpos ) startpos = 0;
-			if ( string::npos != endpos )   endpos = endpos+1-startpos;
-			return str.substr( startpos, endpos );
-		}
-		return str;
-	}
-
-	inline std::string rtrimmed( const std::string& str )
-	{
-		size_t endpos = str.find_last_not_of(" \r\n\t");
-		if ( string::npos != endpos )
-		{
-			return str.substr( 0, endpos+1 );
-		}
-		return str;
-	}
-
-	inline std::string ltrimmed( const std::string& str )
-	{
-		size_t startpos = str.find_first_not_of(" \r\n\t");
-		if( string::npos != startpos )
-		{
-			return str.substr( startpos );
-		}
-		return str;
-	}
-
-	inline bool ends_with( const std::string& s, const std::string & ending )
-	{
-		if ( s.length() >= ending.length() ) {
-			return ( 0 == s.compare (s.length() - ending.length(), ending.length(), ending) );
-		} else {
-			return false;
-		}
-	}
-
-	inline std::string& remove_chars( std::string& s, const std::string& chars ) 
-	{
-		s.erase(nv::remove_if(s.begin(), s.end(), 
-			[&chars](const char& c) {
-				return chars.find(c) != std::string::npos;
-			}), s.end());
-		return s;
-	}
-
-	inline std::string extract_extension( const std::string& filename )
-	{
-		size_t lastdot = filename.find_last_of( "." );
-		std::string ext;
-		if ( std::string::npos != lastdot )
-			ext = filename.substr( lastdot + 1 );
-		transform_seq( ext.begin(), ext.end(), ext.begin(), [=] ( char val ) { return char( ::tolower( val ) ); } );
-		return ext;
-	}
-
-	inline std::string remove_chars_copy( std::string s, const std::string& chars ) 
-	{
-		return remove_chars(s, chars);
-	}
+	std::string slurp( const std::string& filename );
 
 	namespace detail
@@ -264,10 +91,10 @@
 		struct string_length_impl < char* >
 		{
-			static size_t get( const char* s ) { return std::strlen( s ); }
+			static size_t get( const char* s ) { return nvstrlen( s ); }
 		};
 		template<>
 		struct string_length_impl < const char* >
 		{
-			static size_t get( const char* s ) { return std::strlen( s ); }
+			static size_t get( const char* s ) { return nvstrlen( s ); }
 		};
 		template<>
@@ -359,5 +186,5 @@
 		inline char at( size_type i ) const
 		{
-			//	if ( i >= m_data ) NV_THROW( std::out_of_range( "string_ref::at" ) );
+			//	if ( i >= m_data ) NV_THROW( out_of_range( "string_ref::at" ) );
 			return data()[i];
 		}
@@ -370,5 +197,5 @@
 		{
 			size_type this_size = size();
-			int cmp = std::memcmp( data(), rhs.data(), ( nv::min )( this_size, rhs.size() ) );
+			int cmp = nvmemcmp( data(), rhs.data(), ( nv::min )( this_size, rhs.size() ) );
 			return cmp != 0 ? cmp : ( this_size == rhs.size() ? 0 : this_size < rhs.size() ? -1 : 1 );
 		}
@@ -376,10 +203,10 @@
 		bool starts_with( const string_base& s ) const
 		{
-			return size() >= s.size() && std::memcmp( data(), s.data(), s.size() ) == 0;
+			return size() >= s.size() && nvmemcmp( data(), s.data(), s.size() ) == 0;
 		}
 		bool ends_with( char c ) const { return !empty() && c == back(); }
 		bool ends_with( const string_base& s ) const
 		{
-			return size() >= s.size() && std::memcmp( data() + size() - s.size(), s.data(), s.size() ) == 0;
+			return size() >= s.size() && nvmemcmp( data() + size() - s.size(), s.data(), s.size() ) == 0;
 		}
 		size_type find( const string_base& s, size_type pos = 0 ) const
@@ -399,5 +226,5 @@
 			if ( pos >= size() ) return npos;
 			const_reverse_iterator it = search( this->crbegin() + (difference_type)pos, this->crend(), s.crbegin(), s.crend() );
-			return it == this->crend() ? npos : size() - 1 - ( size_type )distance( this->crbegin(), it );
+			return it == this->crend() ? npos : reverse_distance( this->crbegin(), it );
 		}
 		size_type rfind( char c, size_type pos = 0 ) const
@@ -405,5 +232,5 @@
 			if ( pos >= size() ) return npos;
 			const_reverse_iterator it = find_if( this->crbegin() + (difference_type)pos, this->crend(), [=] ( char val ) { return val == c; } );
-			return it == this->crend() ? npos : size() - 1 - ( size_type )distance( this->crbegin(), it );
+			return it == this->crend() ? npos : reverse_distance( this->crbegin(), it );
 		}
 		size_type find_first_of( char c ) const { return find( c ); }
@@ -417,10 +244,10 @@
 		{
 			const_reverse_iterator it = nv::find_first_of( this->crbegin(), this->crend(), s.cbegin(), s.cend() );
-			return it == this->crend() ? npos : size() - 1 - ( size_type )distance( this->crbegin(), it );
+			return it == this->crend() ? npos : reverse_distance( this->crbegin(), it );
 		}
 		size_type find_first_not_of( const string_base& s ) const
 		{
 			for ( const_iterator it = this->cbegin(); it != this->cend(); ++it )
-				if ( 0 == std::memchr( s.data(), *it, s.size() ) )
+				if ( 0 == nvmemchr( s.data(), *it, s.size() ) )
 					return ( size_type )distance( this->cbegin(), it );
 			return npos;
@@ -436,6 +263,6 @@
 		{
 			for ( const_reverse_iterator it = this->crbegin(); it != this->crend(); ++it )
-				if ( 0 == std::memchr( s.data(), *it, s.size() ) )
-					return size() - 1 - (size_type)distance( this->crbegin(), it );
+				if ( 0 == nvmemchr( s.data(), *it, s.size() ) )
+					return reverse_distance( this->crbegin(), it );
 			return npos;
 		}
@@ -444,5 +271,5 @@
 			for ( const_reverse_iterator it = this->crbegin(); it != this->crend(); ++it )
 				if ( c != *it )
-					return size() - 1 - ( size_type )distance( this->crbegin(), it );
+					return reverse_distance( this->crbegin(), it );
 			return npos;
 		}
@@ -466,8 +293,20 @@
 		}
 
+		// Literal constructors
+		template< size_t N >
+		inline string_base( char( &s )[N] ) : detail::data_base< const_storage_view< char > >( s, N - 1 ) {}
+		template< size_t N >
+		inline string_base( const char( &s )[N] ) : detail::data_base< const_storage_view< char > >( s, N - 1 ) {}
+
 	protected:
 		inline NV_CONSTEXPR string_base() : detail::data_base< const_storage_view< char > >() {}
 		inline NV_CONSTEXPR string_base( pointer a_data, size_type a_lenght )
 			: detail::data_base< const_storage_view< char > >( a_data, a_lenght ) {}
+
+		template < typename ReverseIterator >
+		size_type reverse_distance( ReverseIterator first, ReverseIterator last ) const
+		{
+			return size() - 1 - distance( first, last );
+		}
 	};
 
@@ -503,9 +342,9 @@
 		// Non-literal constructors
 		template< typename U >
-		inline string_ref( U str, typename enable_if<is_same<U, const char*>::value>::type* = nullptr ) : string_base( str, std::strlen( str ) ) {}
+		inline string_ref( U str, typename enable_if<is_same<U, const char*>::value>::type* = nullptr ) : string_base( str, nvstrlen( str ) ) {}
 
 		// Non-literal constructors
 		template< typename U >
-		inline string_ref( U str, typename enable_if<is_same<U, char*>::value>::type* = nullptr ) : string_base( str, std::strlen( str ) ) {}
+		inline string_ref( U str, typename enable_if<is_same<U, char*>::value>::type* = nullptr ) : string_base( str, nvstrlen( str ) ) {}
 
 		inline string_ref& operator=( const string_ref &rhs )
@@ -546,5 +385,5 @@
 		explicit const_string( const char* str )
 		{
-			initialize( str, std::strlen( str ) );
+			initialize( str, nvstrlen( str ) );
 		}
 
@@ -582,5 +421,5 @@
 		{
 			char* data = new char[s + 1];
-			std::memcpy( data, p, s );
+			nvmemcpy( data, p, s );
 			data[s] = 0;
 			assign( data, s );
@@ -590,5 +429,5 @@
 	inline string_ref string_base::substr( size_type p, size_type n ) const
 	{
-		if ( p > size() ) return string_ref(); // NV_THROW( std::out_of_range( "substr" ) );
+		if ( p > size() ) return string_ref(); // NV_THROW( out_of_range( "substr" ) );
 		if ( n == p || p + n > size() ) n = size() - p;
 		return string_ref( data() + p, n );
@@ -664,4 +503,47 @@
 size_t f64_to_buffer( f64 n, char* str );
 
+inline string_ref trimmed( const string_ref& str )
+{
+	size_t endpos = str.find_last_not_of( " \r\n\t" );
+	size_t startpos = str.find_first_not_of( " \r\n\t" );
+
+	if ( string::npos != endpos || string::npos != startpos )
+	{
+		if ( string::npos == startpos ) startpos = 0;
+		if ( string::npos != endpos )   endpos = endpos + 1 - startpos;
+		return str.substr( startpos, endpos );
+	}
+	return str;
+}
+
+inline string_ref rtrimmed( const string_ref& str )
+{
+	size_t endpos = str.find_last_not_of( " \r\n\t" );
+	if ( string::npos != endpos )
+	{
+		return str.substr( 0, endpos + 1 );
+	}
+	return str;
+}
+
+inline string_ref ltrimmed( const string_ref& str )
+{
+	size_t startpos = str.find_first_not_of( " \r\n\t" );
+	if ( string::npos != startpos )
+	{
+		return str.substr( startpos );
+	}
+	return str;
+}
+
+
+inline string_ref extract_extension( string_ref filename )
+{
+	size_t lastdot = filename.find_last_of( '.' );
+	if ( string_ref::npos != lastdot )
+		return filename.substr( lastdot + 1 );
+	return filename;
+}
+
 
 }
Index: trunk/nv/stl/traits/properties.hh
===================================================================
--- trunk/nv/stl/traits/properties.hh	(revision 377)
+++ trunk/nv/stl/traits/properties.hh	(revision 378)
@@ -294,4 +294,5 @@
 // TODO: non-standard, remove?
 	template < typename T >	struct has_trivial_constructor : bool_constant < __has_trivial_constructor( T ) || __is_pod( T ) > {};
+	template < typename T >	struct has_trivial_copy        : bool_constant < ( __has_trivial_copy( T ) || __is_pod( T ) ) && ( !is_volatile<T>::value ) > {};
 	template < typename T >	struct has_trivial_assign      : bool_constant < ( __has_trivial_assign( T ) || __is_pod( T ) ) && ( !is_volatile<T>::value && !is_const<T>::value ) > {};
 	template < typename T >	struct has_trivial_destructor  : bool_constant < __has_trivial_destructor( T ) || __is_pod( T ) > {};
Index: trunk/src/gui/gui_gfx_renderer.cc
===================================================================
--- trunk/src/gui/gui_gfx_renderer.cc	(revision 377)
+++ trunk/src/gui/gui_gfx_renderer.cc	(revision 378)
@@ -190,5 +190,5 @@
 {
 	std::string id_name( filename );
-	id_name.append( to_string( size ) );
+	id_name.append( std::to_string( size ) );
 	auto i = m_font_names.find( id_name );
 	if ( i != m_font_names.end() )
Index: trunk/src/lua/lua_area.cc
===================================================================
--- trunk/src/lua/lua_area.cc	(revision 377)
+++ trunk/src/lua/lua_area.cc	(revision 378)
@@ -8,5 +8,4 @@
 
 #include "nv/lua/lua_raw.hh"
-#include "nv/stl/string.hh"
 #include "nv/core/random.hh"
 
@@ -325,14 +324,5 @@
 {
 	nv::rectangle a = to_area( L, 1 );
-	std::string s = "(";
-	s += nv::to_string(a.ul.x);
-	s += ",";
-	s += nv::to_string(a.ul.y);
-	s += "x";
-	s += nv::to_string(a.lr.x);
-	s += ",";
-	s += nv::to_string(a.lr.y);
-	s += ")";
-	lua_pushstring( L, s.c_str() );
+	lua_pushfstring( L, "(%d,%dx%d,%d)", a.ul.x, a.ul.y, a.lr.x, a.lr.y );
 	return 1;
 }
Index: trunk/src/lua/lua_glm.cc
===================================================================
--- trunk/src/lua/lua_glm.cc	(revision 377)
+++ trunk/src/lua/lua_glm.cc	(revision 378)
@@ -8,6 +8,6 @@
 
 #include "nv/lua/lua_raw.hh"
-#include "nv/stl/string.hh"
 #include "nv/core/random.hh"
+#include "nv/stl/traits/common.hh"
 
 static size_t nlua_swizzel_lookup[256];
@@ -292,12 +292,14 @@
 {
 	T v = to_vec<T>( L, 1 );
-	std::string s = "(";
-	for ( size_t i = 0; i < v.length(); ++i )
-	{
-		if (i > 0) s += ",";
-		s += nv::to_string(v[i]);
-	}
-	s+=")";
-	lua_pushstring( L, s.c_str() );
+	bool fl = nv::is_floating_point<typename T::value_type>::value;
+	switch ( v.length() )
+	{
+	case 1: lua_pushfstring( L, ( fl ? "(%f)"          : "(%d)" ),          v[0] );
+	case 2: lua_pushfstring( L, ( fl ? "(%f,%f)"       : "(%d,%d)" ),       v[0], v[1] );
+	case 3: lua_pushfstring( L, ( fl ? "(%f,%f,%f)"    : "(%d,%d,%d)" ),    v[0], v[1], v[2] );
+	case 4: lua_pushfstring( L, ( fl ? "(%f,%f,%f,%f)" : "(%d,%d,%d,%d)" ), v[0], v[1], v[2], v[3] );
+	default:
+		lua_pushliteral( L, "(vector?)" ); break;
+	}
 	return 1;
 }
Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 377)
+++ trunk/src/lua/lua_map_tile.cc	(revision 378)
@@ -55,6 +55,11 @@
 	nv::map_area* map_area = nv::lua::detail::to_map_area( L, 3 );
 	lua_settop( L, 2 );
-	std::string code = nv::trimmed( lua_tostring( L, 1 ) );
-	nv::remove_chars( code, " \r\t" );
+	std::string code = nv::trimmed( lua_tostring( L, 1 ) ).to_string();
+	std::string chars( " \r\t" );
+	code.erase( nv::remove_if( code.begin(), code.end(),
+		[&chars] ( const char& c )
+	{
+		return chars.find( c ) != std::string::npos;
+	} ), code.end() );
 
 	map_tile tile;
Index: trunk/src/stl/assert.cc
===================================================================
--- trunk/src/stl/assert.cc	(revision 377)
+++ trunk/src/stl/assert.cc	(revision 378)
@@ -34,5 +34,8 @@
 }
 #	else
-#include <assert.h>
+extern "C" {
+	extern void __assert_fail(const char *, const char *, unsigned int, const char *)
+		throw() __attribute__ ((__noreturn__));
+}
 #	endif
 void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
Index: trunk/src/stl/string.cc
===================================================================
--- trunk/src/stl/string.cc	(revision 377)
+++ trunk/src/stl/string.cc	(revision 378)
@@ -11,4 +11,5 @@
 #include <cstdio>
 #include <cstdlib>
+#include <fstream> // for slurp only
 
 using namespace nv;
@@ -16,4 +17,13 @@
 static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000,
 10000000, 100000000, 1000000000 };
+
+std::string nv::slurp( const std::string& filename )
+{
+	std::ifstream input( filename );
+	//		if ( !input.is_open() ) NV_THROW( std::runtime_error, "File "+filename+" not found!");
+	std::stringstream sstr;
+	while ( input >> sstr.rdbuf() );
+	return sstr.str();
+}
 
 static inline void string_reverse( char* begin, char* end )
