fix issue #653

Fixes BSON serialization of const classes with `from/toBson` methods.