Changes per code review

*  Externalize js file and use AssetManager to load in script
*  Add back the check in the helper for anonymous users (pages are not cached for
logged in users)
*  Remove `$this->response->addAsset` call in the controller (duplicated now that
the hook is adding the js)