Add unit test for BSON serialization of const classes (see #653).