Port from c++ to C api to allow mingw and linux support?

Port from c++ to C and get cmakelists working for windows visual studio and mingw builds as well as osx builds. Builds the so file for android (requires mods to moai activity and copying of libs to project)