Add unit tests

This should create `Buffer`s not `Uint8Array`.  Also, with a `Buffer` you can do: `return new Buffer(array)`.