Better setTimeout/clearTimeout for javascript