Various code cleanups, trying make clean MVC based system.