Merge changes I6902e052,I39a7f08a,I26771887

* changes:
  Extract Gesture handling code and test it
  Make assertPosition a method of FakePointerController
  Extract HardwareState conversion into a class and test it