[Resolution] Add smart backtracking

I'd like to know if there are any performance shortcuts that are obvious here, @floere.

I'd also really appreciate testing this out on some `Podfile`s with resolvable conflicts to make sure the speed increase is real, @kylef @alloy. (I discovered this optimization working with bundler code)

\c @indirect
What's the reason for creating a hash from a hash? Ie:

```ruby
Hash[requirements.select { |_, r| !r.empty? }]
```

Instead of

```ruby
requirements.select { |_, r| !r.empty? }
```