Extracted db related part in separate project

Also added sample home page with a redirecting search text box (it
should be easy to fix it once we have data in the database).