Rewrite distances page to use date intervals and ranges

Disable navigation options that have no data to show
Add redirect and error redirect functions
Add error for time intervals that have no data