Fix error with Python 2.7+ code path

When adding support for lack of timedelta.total_seconds() in Pyhton 2,6,
the 2.7 alternative wasn't finished.
Save the current range in the query string

When the user selects a range (Day/Week/Month/Year), modify the
query string (without adding an item to the history), and read
the query string on load.
Cleanup: refactor common code
Pass range type and position when navigating between pages

When the user switches pages, pass the range type (day, week,
etc) and the center position so they can investigate the same
data on other pages. Do this dynamically by intercepting
the click event on URLs.
Add click-and-drag scrolling

On tablets and mobile or even on a desktop having the only way to
scroll the graphs is scroll-wheel is annoying. Add click-and-drag
scrolling for both the graphs and for simple scrolling of the left
and right divs.