Bug 985541 - Turn GestureEventListener into Finite-state machine. r=kats,drs