Added experimental swipe gesture. Other minor refactoring.