Fix #152 "Unexpected result with variable inside an <xf:bind> iteration"

- pass BindNode as context to variable resolver
- implement variable resolution algorithm
- some refactoring
- tests