Provides get_field and get_fields accessors for composite types. This abstacts over the fields key being a map or a function that returns a map.