Massive reorganization of code into something more maintainable.