Extracted timer code into separate js file.