Diverging from original and abandoning template-generated code. Merged generated and non-generated classes, added many new methods and classes.