Changes in DB module, changes in db handling, less global variables