Fix calculateDistance on slider to work in iframes and all devices.

Make the slider use changedTouches, if available, for calculateDistance. `event.changedTouches` are only available when touch is available.
Add tests to make sure we get the correct ratio for calculateDistance