Add support for rotation and for direct use on a Raspberry Pi
Tidy up rotation code until Kivy Android rotation can be automatic.