Change the parameters of 'wait_for' to a Hash and deprecate the old parameters