Matlab BSON encoder based on libbson.