Provide support for removing an operation from the block that contains it and
moving it back to detached state. This allows for the operation to be moved to
a different block, a common IR manipulation for, e.g., module merging.
Also fix a potential one-past-end iterator dereference in Operation::moveAfter
discovered in the process.
Could the same comment "style" as in line 342 be used here? (I think if you s/Creates/Removes/ and s/inserted/destroyed/ it works here and then it is formulaic how one reads these :-))