Code refinements/clean up. Added mocha and chai to test/vendor.