Added Database class (+ minor fixes)
Added Database class (+ minor fixes)