Refactor JS

Moving some utility functions out of ` brandingbar.js ` and bundling them back up using browserify. The file size of the compiled file is a bit larger now because of the ` require('es5-shim'); `.
Most of the changes to this file are due to the indentation change.