Removing cruft, adding functional tests into mocha suite