put functions declared int lua_api.hpp in a new file lua_api.cpp

i also added some declarations of functions from lua.cpp to lua_api.hpp


plus i added the file lua_types.hpp because i didnt like all the static_cast<void *>(const_cast<char *>(x)) casts