Added CRUD functionality for pacakges

Corrected various mistakes in DB classes.