Client script unit tested

Testing using Mocha on the snippet of client script that processes html
output. The client script now structured as a module to allow unit
testing in node.