Added ability to set hook on resource bind. Resolves #50

To not break existing api, if there is no listeners for event, stream uses old behavior. It is also possible now to send error instead of binding a resource.