Refactored as NPM/Bower project. Replaced for loops with lodash loops.