Fixed bug with master table relationships.

Also added "type-based" transform at entity level.  It will apply
transform on field if types match. (e.g. toLocalTime method on all
DateTime fields.  Also added some join checks, and errors / exits if
configured wrong.