toString, equals and hashcode now work properly with cyclic model structures. Refactored proxy class generator to be more readable.