Allow custom BSON/JSON (de)serializer for children of documents and arrays

I use the JSON serializer to create output for a REST API, but need to change how BSONDocumentIDs are serialized. This change makes it easier to change to override how builtin data types are converted, without the need to copy/paste and change several PartialFormats that are already present.