Fixes issue #70, adds support for domains

Explicitly binds the callback to a domain if one is present.