Finished refacto to MVC and some bug fixes.