Major refactoring for allowing detecting multiple gestures together, fixes #2