Calculate sleep time from failed attempt

These changes introduce new way to calculate sleep time from failed attempt. New strategy AttemptWaitStrategy is based on exception class and user-defined function to calculate sleep time from exception occurred.