Setup was horked after this commit and I couldn't easily make it right so reverting - will try again at a future date Revert "remove global db variable" This reverts commit c3b0c0f3.