Refactor and delint

Break up the massive addMultiTask function into comprehensible pieces. I
think reading the source code should be far easier now.

Also added more direct unit tests that doesn't depend on just testing the
output of running the grunt tasks, but tests the js directly.