Refactoring code

Extracted some functions into new npm packages, removed the manual
mocha setup, added a gulpfile, and bumped the version number.