A Javascript class for delaying actions