Enable the possiblity of adding complex mappings

This PR enables the possiblity of mapping complex (i.e. array or object) elements in addition to normal scalar fields.