A javascript class for delaying actions