(#1695) Respect priority when merging defaults

This commit adds an extra condition at the beginning of the
`setup-map-defaults` function, such that if one of the two
items being merged has a higher priority than the other,
it is honored.

This seems to fix the issue where the `^:replace` metadata
was not working properly