refactored library-search code to use requirejs and routers