Refactor test database setup for visualizations and overlays