database connection and cursor now class attributes

it's now possible to use the :memory: database for test purposes