Refs #1969: Adds undo support for removing bypass. Some refactoring.