review fixes + added rebind test

-changes based on Sam's review on Gitter.
This will break rebind, because the function cannot be deserialized (because it is an anonymous inner class).