Add tileLayerController and update main.js

Ready to roll, please review

Todo
- [x] add tests
Bit of copypasta here...