Implemented a cleaner MVC implementation. A lot of refactoring.