This is the supporting code for an exercise described in http://matteo.vaccari.name/blog/archives/293