DBHelpers: make code consistent, only open database once

Refactor some DbHelper classes, so that the DbHelper classes look and work similair throughout the project.
Mainly the change is to noe open and close the database in each method call in AccountsManager.