Moved into function

Since Lua is an extension language, there seems to be no standard for having a 'main' function. The best answers I could find are [here] [1]. I went with a solution that hasn't received any feedback (but made sense to me). I haven't found a case where it breaks yet. 

[1]: http://stackoverflow.com/questions/4521085/main-function-in-lua "here"