Implement connection_on for bindings
Improve connection initialization

Add the 'connected' property to indicate whether the connection is
connected. Initalize connection right after construction. Throw the
connection error when trying to use a connection that was initialized
with an error.