Javascript Object that will rerun queries several times before failing and stopping the attempt