Convert #resolve_for into an iterative algorithm (for profit)
Comments and warning fixes
Merge branch 'iterative_resolver'

* iterative_resolver:
  Comments and warning fixes
  Convert #resolve_for into an iterative algorithm (for profit)

This switches the recursive resolver (which can raise SystemStackError for
large dependency graphs) to an iterative resolver which does not have the
same limitation.