A lot of clean-ups and some additional utility functions. Added (manually) data from Endomondo website for comparison.