Qingkai's database commit

First version of database, basic function