Refactored more parts of the GAPL grammar and added more codegen.