Abstract out duplicate resolver code

Hello @nicks, @eford1,

This is a change that will help with removing promises by simplifying one of the chief places where they're used, but I wanted to make it separately for clarity. I commented at two places in the commit where the code actually does something different, but I don't think they should be a problem. I tested this against medium2 as well and everything checks out.

Please review the following commits I made in branch 'kyle-cleanup-resolver-code'.

95fea3d5a65b13ce0ee8c06165534fd0ec6bfc6c (2013-07-29 18:15:11 -0700)
Abstract out duplicate resolver code


R=@nicks
R=@eford1