Implementation of ubjson as a common js module requiring only buffer.