Added support for refactor_pattern context variable, to allow manipulation of the pattern inside the expander Goal