Rewrite to controller as, keep global state on global state object and f...

...ix issue with url not triggering watch