Massive refactoring to make everything object oriented.
dregs of the massive refactoring