Replaced prelude with lodash and some general cleanup