Support touch events so the examples work on tablets/phones.

The code was complicated enough that I thought it was best
to put it in a separate file to share the code across all
9 drafts.