Initial commit

This is still a work in progress but should work in both node and es5
browsers.