rewrote duration unit tests
reworked duration formatting code

- maybe it would be a good idea to 1) extract it somewhere 2) write
some tests