Connection class events and basic cleanup.