Cardinality of an element can be marked in metadata;  fixes issue #161.

Fields are added dynamically.