Added bson serialization.