Cleaned up parser. Created some codegen templates.