Separate the timestring function into a collection of support functions

This will help us to test the function with unit tests.

Signed-off-by: frajasalo <github@frajasalo.de>
Unit test for the timestring function in support.cpp

This unit test triggers an error which occurs if the value for the
seconds reaches 24 hours. This bug is similar issue #1 which original
described a bug with the value of 3601 seconds.

Signed-off-by: frajasalo <github@frajasalo.de>