Establish database connections for every source
The processing of each source takes so long that when the application
reaches the next source, it tries reusing the cursor which fails
with MySql server has gone away.
This establishes the database connection to both Commons and the
monuments database when they are needed, and closed afterwards.
Tests are updated accordingly with more crazy mocking.