- Use angular's resolve (ngRoute) to make sure scope has data loaded
before rendering view.
- Misc refactoring.