split datasource creation / destruction logic out

make a new DatasourceManager class that is responsible for creating or looking up the
maintenance datasource, depending on configuration parameters