Clean up and port from deprecated stuff
I wanted to improve the gesture support originally, but all the deprecation warnings annoyed me. I can squash it up into better commits if people think that all the changes should go in.
Edited by Martin Tobias Holmedahl Sandsmark