Move demo code into handler.

I am slowly introducing duplication because the abstractions don't
seem to be right, and duplication might let me see what the actual
abstractions that I need are.