Function bind

This seems to have disappeared off the face of the earth, due to a bad merge conflict resolution.

I'm going to merge as has already been reviewed.