Refactoring to support both interactive and non-interactive transitions.

The non-interactive transitions now work. The skeleton is there for the
interactive one.