Cleaned up class constructor and properties generation. Some general code cleanup.