Database logging

This PR is to add monitoring of a database to ensure that conviron scripts do not crash silently. This resolves issue #12 and fully implements issue #4.
Kevin