move javascript to asset pipeline and page-specific script into the js library, since we defer script loading