Moved the swipe calculations and recording to a separate class to help prepare for widget support.