Bind handler

Redid this pull request with an included test case and verified all test cases still pass.