Fix contention and locks issue

Hey @malthe 
please take a look at the changes below.

This PR includes your work on #1 
The changes I've made were required in order to avoid pq re-connect on every scheduled task this way exhausting any available database/pool connection.

I also updated `setup.py` to include required deps so that the tests could be run.

The benchmarks show almost no changes in performance.
Thank you in advance.
I think the idea of using a context manager is excellent, but I think this might be clearer as a syntax:
```python
with assert_execution_time(lambda secs: 0 < secs < 6):
    self.assertEqual(get(), None)
```
But yes, I think this pattern would be good to reuse elsewhere in the test suite.