Fix resolving ref against resolution scope

Signed-off-by: Jesse Stuart <jesse@jessestuart.ca>
Merge pull request #40 from cupcake/fix-ref-resolution

Fix resolving ref against resolution scope