test enhancements

- allow db parameters via environment
- sanity check connection and drop tables if psycopg2 present
- optional support for resetting datadir before runs