Factor out map `IUnifyWithTerms` implementation to `unify-with-map*` function.

This makes it easier for consumers to extend map-like unification to their own records without copy/pasting.