countdown.js: fix things and add some abstraction