Rewrite 'browser' service in CoffeeScript, add tests