Linux

There were a few things that prevented the linux build to work.
I rebased it from master, and fixed everything. 
Got moai binary working, and added moai-test, that compiles but segfaults when running a test.