Finish working on the early version of BaseDao and Dao.

The BaseDao passes all basic tests cases.