Refactored timer js. Now more object oriented