modified timer logic to support arbitrary times, moved non-template logic ot main.js