Improve Connection class

Implement invite generation support. Implement registration support.