Fix line ending issues
Add lodash, do some JS cleanup.

Added the lodash library to start making things a little more functional
if possible, and did some minor javascript cleanup.