Lots of tests. Ready for npm.