Continue codegen implementation, fix codegen for functions to support mutual recursion, refactoring.