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