Ruby implementation of BSON