Pure Perl implementation of BSON