Add database class and lib