Pull out WorkflowOp merging as a separate operator

This gives us another option for testing workflow construction, which should be helpful as things continue to get more complicated.
This feels dirty, but we already had a similar cast in `rewriteRefs` a few lines earlier. In fact, this use of the singleton type confuses the compiler, necessitating an ugly helper method later on (see comment below).

It seems like there must be a better way, but I was not able to find an elegant solution. Of course, there are several inelegant solutions... @jdegoes?