A first stab at implementing the clip lifecycle.

Currently it managed to do one transition and then gets stuck, so not
perfect yet but a reasonable checkpoint.