Adds automation flipping.

Implements #1289.
what is the purpose of the cleanObjects() call here? Flipping shouldn't require any changes to the automation connections.