Create Main.lua

Separate out execution code and API