refactors initialization/cleanup of tests for mysql and postgresql