Added transition function.

Roughly equivalent to jsonify, but for converting to transition.
transitify seemed like bad English, so going to call it transition for
now.  May change the name at a later date.