Fix bugs in timestr(), converting msec to time string

Also adds a docstring for timestr().
Add unit tests for timestr()
Merge pull request #31 from olof/topic/timestr_fixes_unittest

Unittests for timestr