PYTHON-346 - Add _encode_mapping, cache subtypes.