Collapse connection and session to context [IMMUTANT-498]