Various fixes

Rather than passing functions in as arguments, add base implementations that don't do anything. So, subclasses will implement `on_connect` and `on_disconnect`.