Refactoring to support different i/o devices (in preparation for
implementing with PiPlate LCD)