Add subclass matching to serializer field mapping.

First attempt at #1809.
Looks clean to me! Although I find LISP clean too, so don't ask me.