Refactor

* move all database access code into database package (access.py)
* improve index page logic
* improve search logic
* add pagenation to search result
* integrate search result to index page
Fix

* add new keyword error
* improve search