Implement timer module with unit test

move this to utils.lua?