Importing of totd into git repo

Code is basically the totd-1.5.1 release plus some fixes.