Adding Rotary Encoder handler. Based on Ben Buxton's implementation.