Refactoring of how MERGE is parser, in preparation for MERGE for patterns