Implement serializer support for arbitrary classes (WIP).