refactor the database: modify table favorites and add table apps.
Merge pull request #6 from cooee-zen/suyu_issue2

refactor the database: modify table favorites and add table apps.
modify codes to fit new database.
Merge pull request #7 from cooee-zen/suyu_issue3

modify codes to fit new database.
Merge remote-tracking branch 'origin/master' into henghao_issue4