Database: move logic from Connection to Container (renamed from SelectionFactory)

Suggestion how to rename things and make further composition with db.

For this time compatible with 2.0 without bc breaks, just deprecation.