Add underscore.js and convert most for loops to forEach.