refactoring code to async "bower install and npm install" on server client side