Add touch support

Works on the iPad now :-)

Also clean up some stuff like indentation and trailing whitespace.