Adds tests and Travis-CI; more robust error handling.
Merge branch 'tests'

Conflicts:
	README.md
	lib/index.js
	package.json