Started code generation for function calls.

Refactoring: moved VM state struct into machine.lua