added tests
bind rewrite

Clearer signature and no dependencies.
Merge branch 'tests'