Cherrypick of resque + a non-forking bugfix.