A little bit of refactoring

* Making better use TypeScript language features
* Pulling controller out into its own folder