Code style and related minor performance optimizations

- Get rid of unneeded anonymous function callbacks for some `.map()` calls.
- Avoid calling `_.uniq()` twice in a row with the same argument.
- Fix and enforce consistency on whitespacing code style.