Index: trunk/nv/gl/gl_enum.hh
===================================================================
--- trunk/nv/gl/gl_enum.hh	(revision 213)
+++ trunk/nv/gl/gl_enum.hh	(revision 214)
@@ -13,4 +13,5 @@
 #define NV_GL_ENUM_HH
 
+#include <nv/math.hh>
 #include <nv/interface/clear_state.hh>
 #include <nv/interface/render_state.hh>
@@ -18,5 +19,4 @@
 #include <nv/interface/texture2d.hh>
 #include <nv/interface/context.hh>
-#include <nv/types.hh>
 
 namespace nv
Index: trunk/nv/interface/clear_state.hh
===================================================================
--- trunk/nv/interface/clear_state.hh	(revision 213)
+++ trunk/nv/interface/clear_state.hh	(revision 214)
@@ -15,5 +15,5 @@
 
 #include <nv/common.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 
 namespace nv
Index: trunk/nv/interface/mesh.hh
===================================================================
--- trunk/nv/interface/mesh.hh	(revision 213)
+++ trunk/nv/interface/mesh.hh	(revision 214)
@@ -16,5 +16,5 @@
 #include <nv/common.hh>
 #include <nv/string.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 #include <nv/interface/context.hh>
 #include <unordered_map>
Index: trunk/nv/interface/program.hh
===================================================================
--- trunk/nv/interface/program.hh	(revision 213)
+++ trunk/nv/interface/program.hh	(revision 214)
@@ -18,5 +18,5 @@
 #include <nv/common.hh>
 #include <nv/string.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 
 namespace nv
Index: trunk/nv/interface/render_state.hh
===================================================================
--- trunk/nv/interface/render_state.hh	(revision 213)
+++ trunk/nv/interface/render_state.hh	(revision 214)
@@ -15,5 +15,5 @@
 
 #include <nv/common.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 #include <nv/interface/clear_state.hh>
 #include <nv/string.hh>
Index: trunk/nv/interface/texture2d.hh
===================================================================
--- trunk/nv/interface/texture2d.hh	(revision 213)
+++ trunk/nv/interface/texture2d.hh	(revision 214)
@@ -14,5 +14,5 @@
 
 #include <nv/common.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 
 namespace nv
Index: trunk/nv/interface/vertex_buffer.hh
===================================================================
--- trunk/nv/interface/vertex_buffer.hh	(revision 213)
+++ trunk/nv/interface/vertex_buffer.hh	(revision 214)
@@ -14,5 +14,5 @@
 
 #include <nv/common.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 #include <unordered_map>
 #include <string>
Index: trunk/nv/io_event.hh
===================================================================
--- trunk/nv/io_event.hh	(revision 213)
+++ trunk/nv/io_event.hh	(revision 214)
@@ -15,5 +15,4 @@
 
 #include <nv/common.hh>
-#include <nv/types.hh>
 
 namespace nv
Index: trunk/nv/math.hh
===================================================================
--- trunk/nv/math.hh	(revision 213)
+++ trunk/nv/math.hh	(revision 214)
@@ -8,4 +8,6 @@
 #define NV_MATH_HH
 
+#include <nv/common.hh>
+
 #if NV_COMPILER == NV_GNUC
 #pragma GCC system_header
@@ -14,5 +16,4 @@
 #endif
 
-#include <nv/common.hh>
 #include <glm/glm.hpp>
 #include <glm/gtc/matrix_transform.hpp>
@@ -75,4 +76,84 @@
 	using glm::min;
 
+	enum datatype
+	{
+		INT,
+		BYTE,
+		SHORT,
+		UINT,
+		UBYTE,
+		USHORT,
+		FLOAT,
+		FLOAT_VECTOR_2,
+		FLOAT_VECTOR_3,
+		FLOAT_VECTOR_4,
+		FLOAT_MATRIX_2,
+		FLOAT_MATRIX_3,
+		FLOAT_MATRIX_4,
+		INT_VECTOR_2,
+		INT_VECTOR_3,
+		INT_VECTOR_4,
+		// unsupported gl conversion, remove?
+		BYTE_VECTOR_2, 
+		BYTE_VECTOR_3,
+		BYTE_VECTOR_4,
+	};
+
+	template < datatype EnumType > struct enum_to_type {};
+
+	template <> struct enum_to_type< INT >   { typedef int type; };
+	template <> struct enum_to_type< UINT >  { typedef unsigned int type; };
+	template <> struct enum_to_type< SHORT > { typedef short type; };
+	template <> struct enum_to_type< USHORT >{ typedef unsigned short type; };
+	template <> struct enum_to_type< BYTE >  { typedef char type; };
+	template <> struct enum_to_type< UBYTE > { typedef unsigned char type; };
+	template <> struct enum_to_type< FLOAT > { typedef f32 type; };
+
+	template <> struct enum_to_type< FLOAT_VECTOR_2 > { typedef vec2 type; };
+	template <> struct enum_to_type< FLOAT_VECTOR_3 > { typedef vec3 type; };
+	template <> struct enum_to_type< FLOAT_VECTOR_4 > { typedef vec4 type; };
+
+	template <> struct enum_to_type< INT_VECTOR_2 > { typedef ivec2 type; };
+	template <> struct enum_to_type< INT_VECTOR_3 > { typedef ivec3 type; };
+	template <> struct enum_to_type< INT_VECTOR_4 > { typedef ivec4 type; };
+
+	template <> struct enum_to_type< BYTE_VECTOR_2 > { typedef i8vec2 type; };
+	template <> struct enum_to_type< BYTE_VECTOR_3 > { typedef i8vec3 type; };
+	template <> struct enum_to_type< BYTE_VECTOR_4 > { typedef i8vec4 type; };
+
+	template <> struct enum_to_type< FLOAT_MATRIX_2 > { typedef mat2 type; };
+	template <> struct enum_to_type< FLOAT_MATRIX_3 > { typedef mat3 type; };
+	template <> struct enum_to_type< FLOAT_MATRIX_4 > { typedef mat4 type; };
+
+	template < typename TYPE > struct type_to_enum {};
+
+	template <> struct type_to_enum< long >          { static const datatype type = INT; };
+	template <> struct type_to_enum< unsigned long > { static const datatype type = UINT; };
+	template <> struct type_to_enum< int >           { static const datatype type = INT; };
+	template <> struct type_to_enum< unsigned int >  { static const datatype type = UINT; };
+	template <> struct type_to_enum< short >         { static const datatype type = SHORT; };
+	template <> struct type_to_enum< unsigned short >{ static const datatype type = USHORT; };
+	template <> struct type_to_enum< char >          { static const datatype type = BYTE; };
+	template <> struct type_to_enum< signed char >   { static const datatype type = BYTE; };
+	template <> struct type_to_enum< unsigned char > { static const datatype type = UBYTE; };
+	template <> struct type_to_enum< f32 > { static const datatype type = FLOAT; };
+
+	template <> struct type_to_enum< vec2 > { static const datatype type = FLOAT_VECTOR_2; };
+	template <> struct type_to_enum< vec3 > { static const datatype type = FLOAT_VECTOR_3; };
+	template <> struct type_to_enum< vec4 > { static const datatype type = FLOAT_VECTOR_4; };
+
+	template <> struct type_to_enum< ivec2 > { static const datatype type = INT_VECTOR_2; };
+	template <> struct type_to_enum< ivec3 > { static const datatype type = INT_VECTOR_3; };
+	template <> struct type_to_enum< ivec4 > { static const datatype type = INT_VECTOR_4; };
+
+	template <> struct type_to_enum< i8vec2 > { static const datatype type = BYTE_VECTOR_2; };
+	template <> struct type_to_enum< i8vec3 > { static const datatype type = BYTE_VECTOR_3; };
+	template <> struct type_to_enum< i8vec4 > { static const datatype type = BYTE_VECTOR_4; };
+
+	template <> struct type_to_enum< mat2 > { static const datatype type = FLOAT_MATRIX_2; };
+	template <> struct type_to_enum< mat3 > { static const datatype type = FLOAT_MATRIX_3; };
+	template <> struct type_to_enum< mat4 > { static const datatype type = FLOAT_MATRIX_4; };
+
+
 } // namespace nv
 
Index: trunk/nv/type_traits.hh
===================================================================
--- trunk/nv/type_traits.hh	(revision 213)
+++ trunk/nv/type_traits.hh	(revision 214)
@@ -181,4 +181,31 @@
 	};
 
+	template<typename T>
+	struct is_container
+	{
+	private:
+		typedef char                      yes;
+		typedef struct { char array[2]; } no;
+		template<typename C> static yes test(typename C::iterator*);
+		template<typename C> static no  test(...);
+	public:
+		static const bool value = sizeof(test<T>(0)) == sizeof(yes);
+	};
+
+	template<>
+	struct is_container< std::string > {
+		static const bool value = false;
+	};
+
+	template <typename TYPE> 
+	void construct_object(void* object)
+	{
+		new (object) TYPE;
+	}
+	template <typename TYPE> 
+	void destroy_object(void* object)
+	{
+		((TYPE*)object)->TYPE::~TYPE();
+	}
 }
 
Index: trunk/nv/types.hh
===================================================================
--- trunk/nv/types.hh	(revision 213)
+++ trunk/nv/types.hh	(revision 214)
@@ -9,5 +9,5 @@
 #include <nv/math.hh>
 #include <nv/object.hh>
-#include <type_traits>
+#include <nv/type_traits.hh>
 #include <typeinfo>
 #include <typeindex>
@@ -20,111 +20,5 @@
 namespace nv
 {
-	enum datatype
-	{
-		INT,
-		BYTE,
-		SHORT,
-		UINT,
-		UBYTE,
-		USHORT,
-		FLOAT,
-		FLOAT_VECTOR_2,
-		FLOAT_VECTOR_3,
-		FLOAT_VECTOR_4,
-		FLOAT_MATRIX_2,
-		FLOAT_MATRIX_3,
-		FLOAT_MATRIX_4,
-		INT_VECTOR_2,
-		INT_VECTOR_3,
-		INT_VECTOR_4,
-		// unsupported gl conversion, remove?
-		BYTE_VECTOR_2, 
-		BYTE_VECTOR_3,
-		BYTE_VECTOR_4,
-	};
-
-	template < datatype EnumType > struct enum_to_type {};
-
-	template <> struct enum_to_type< INT >   { typedef int type; };
-	template <> struct enum_to_type< UINT >  { typedef unsigned int type; };
-	template <> struct enum_to_type< SHORT > { typedef short type; };
-	template <> struct enum_to_type< USHORT >{ typedef unsigned short type; };
-	template <> struct enum_to_type< BYTE >  { typedef char type; };
-	template <> struct enum_to_type< UBYTE > { typedef unsigned char type; };
-	template <> struct enum_to_type< FLOAT > { typedef f32 type; };
-
-	template <> struct enum_to_type< FLOAT_VECTOR_2 > { typedef vec2 type; };
-	template <> struct enum_to_type< FLOAT_VECTOR_3 > { typedef vec3 type; };
-	template <> struct enum_to_type< FLOAT_VECTOR_4 > { typedef vec4 type; };
-
-	template <> struct enum_to_type< INT_VECTOR_2 > { typedef ivec2 type; };
-	template <> struct enum_to_type< INT_VECTOR_3 > { typedef ivec3 type; };
-	template <> struct enum_to_type< INT_VECTOR_4 > { typedef ivec4 type; };
-
-	template <> struct enum_to_type< BYTE_VECTOR_2 > { typedef i8vec2 type; };
-	template <> struct enum_to_type< BYTE_VECTOR_3 > { typedef i8vec3 type; };
-	template <> struct enum_to_type< BYTE_VECTOR_4 > { typedef i8vec4 type; };
-
-	template <> struct enum_to_type< FLOAT_MATRIX_2 > { typedef mat2 type; };
-	template <> struct enum_to_type< FLOAT_MATRIX_3 > { typedef mat3 type; };
-	template <> struct enum_to_type< FLOAT_MATRIX_4 > { typedef mat4 type; };
-
-	template < typename TYPE > struct type_to_enum {};
-
-	template <> struct type_to_enum< long >          { static const datatype type = INT; };
-	template <> struct type_to_enum< unsigned long > { static const datatype type = UINT; };
-	template <> struct type_to_enum< int >           { static const datatype type = INT; };
-	template <> struct type_to_enum< unsigned int >  { static const datatype type = UINT; };
-	template <> struct type_to_enum< short >         { static const datatype type = SHORT; };
-	template <> struct type_to_enum< unsigned short >{ static const datatype type = USHORT; };
-	template <> struct type_to_enum< char >          { static const datatype type = BYTE; };
-	template <> struct type_to_enum< signed char >   { static const datatype type = BYTE; };
-	template <> struct type_to_enum< unsigned char > { static const datatype type = UBYTE; };
-	template <> struct type_to_enum< f32 > { static const datatype type = FLOAT; };
-
-	template <> struct type_to_enum< vec2 > { static const datatype type = FLOAT_VECTOR_2; };
-	template <> struct type_to_enum< vec3 > { static const datatype type = FLOAT_VECTOR_3; };
-	template <> struct type_to_enum< vec4 > { static const datatype type = FLOAT_VECTOR_4; };
-
-	template <> struct type_to_enum< ivec2 > { static const datatype type = INT_VECTOR_2; };
-	template <> struct type_to_enum< ivec3 > { static const datatype type = INT_VECTOR_3; };
-	template <> struct type_to_enum< ivec4 > { static const datatype type = INT_VECTOR_4; };
-
-	template <> struct type_to_enum< i8vec2 > { static const datatype type = BYTE_VECTOR_2; };
-	template <> struct type_to_enum< i8vec3 > { static const datatype type = BYTE_VECTOR_3; };
-	template <> struct type_to_enum< i8vec4 > { static const datatype type = BYTE_VECTOR_4; };
-
-	template <> struct type_to_enum< mat2 > { static const datatype type = FLOAT_MATRIX_2; };
-	template <> struct type_to_enum< mat3 > { static const datatype type = FLOAT_MATRIX_3; };
-	template <> struct type_to_enum< mat4 > { static const datatype type = FLOAT_MATRIX_4; };
-
-	template<typename T>
-	struct is_container
-	{
-		private:
-			typedef char                      yes;
-			typedef struct { char array[2]; } no;
-			template<typename C> static yes test(typename C::iterator*);
-			template<typename C> static no  test(...);
-		public:
-			static const bool value = sizeof(test<T>(0)) == sizeof(yes);
-	};
-
-	template<>
-	struct is_container< std::string > {
-		static const bool value = false;
-	};
-
-	template <typename TYPE> void ConstructObject(void* object)
-	{
-		// Use placement new to call the constructor
-		new (object) TYPE;
-	}
-	template <typename TYPE> void DestructObject(void* object)
-	{
-		// Explicit call of the destructor
-		((TYPE*)object)->TYPE::~TYPE();
-	}
-    
+
 	struct type_entry;
 
@@ -255,6 +149,6 @@
 			i_type->size    = sizeof(TYPE);
 
-			i_type->constructor = ConstructObject<TYPE>;
-			i_type->destructor  = DestructObject<TYPE>;
+			i_type->constructor = construct_object<TYPE>;
+			i_type->destructor  = destroy_object<TYPE>;
 
 			m_name_types[name]        = i_type;
Index: trunk/src/io_event.cc
===================================================================
--- trunk/src/io_event.cc	(revision 213)
+++ trunk/src/io_event.cc	(revision 214)
@@ -6,4 +6,6 @@
 
 #include "nv/io_event.hh"
+
+#include <nv/types.hh>
 
 using namespace nv;
Index: trunk/tests/cachebuf_test/nv_cachebuf_test.cc
===================================================================
--- trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 213)
+++ trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 214)
@@ -12,5 +12,4 @@
 #include <glm/gtc/type_ptr.hpp>
 #include <nv/string.hh>
-#include <nv/types.hh>
 #include <nv/interface/mesh.hh>
 #include <cstdlib> // rand
Index: trunk/tests/lualib_test/init.lua
===================================================================
--- trunk/tests/lualib_test/init.lua	(revision 213)
+++ trunk/tests/lualib_test/init.lua	(revision 214)
@@ -0,0 +1,2 @@
+print "hello world from Lua!"
+hello( "Hello" )
Index: trunk/tests/lualib_test/lualib_test.cc
===================================================================
--- trunk/tests/lualib_test/lualib_test.cc	(revision 213)
+++ trunk/tests/lualib_test/lualib_test.cc	(revision 214)
@@ -5,5 +5,5 @@
 #include <nv/lua/lua_glm.hh>
 #include <nv/logger.hh>
-#include <nv/types.hh>
+#include <nv/math.hh>
 #include <nv/object.hh>
 #include <string>
Index: trunk/tests/md2_test/md2_test.cc
===================================================================
--- trunk/tests/md2_test/md2_test.cc	(revision 213)
+++ trunk/tests/md2_test/md2_test.cc	(revision 214)
@@ -18,5 +18,4 @@
 #include <nv/time.hh>
 #include <nv/string.hh>
-#include <nv/types.hh>
 #include <nv/interface/mesh.hh>
 #include <glm/gtx/rotate_vector.hpp>
Index: trunk/tests/objload_test/objload_test.cc
===================================================================
--- trunk/tests/objload_test/objload_test.cc	(revision 213)
+++ trunk/tests/objload_test/objload_test.cc	(revision 214)
@@ -13,5 +13,4 @@
 #include <nv/math.hh>
 #include <nv/string.hh>
-#include <nv/types.hh>
 #include <nv/interface/mesh.hh>
 
Index: trunk/tests/render_test/rl.cc
===================================================================
--- trunk/tests/render_test/rl.cc	(revision 213)
+++ trunk/tests/render_test/rl.cc	(revision 214)
@@ -10,5 +10,4 @@
 #include <nv/math.hh>
 #include <nv/string.hh>
-#include <nv/types.hh>
 #include <nv/interface/mesh.hh>
 
