Abstract swipe.js so it can be a library