Update to node master

Also ported tests, fixed endDecoder & added require("buffer") for browserify