bson fixes for MongoCode

closes #5
Merge pull request #33 from Pomyk/mongo_code

bson fixes for MongoCode