Implemented 'type' support for fields that needed it, and added unit tests.