added formatTime helper function to display session duration as human
readable and implemented in several places.