Add mocha unit-tests for lb-ng script

This is a follow-up for #2. @ritch, I am glad you insisted on adding tests, they found two bugs in my code.

The test code is using bluebird & mocha-as-promised for the sake of consistency with the karma (e2e) tests.

/to @ritch please review
/cc @seanbrookes