Switched codegen variable types from string to class.
Added locals/relations distinction on data.
Added properties for relations and remotes.
Better yet, this should be in the server rather than the templates.