Show processed count of each worker

The commit also do lots of refactoring. Includes move db access logic into
dbapi from views.py
add run_test.sh script to run flake8 test
Ignore some error of flake8
Add flake8 into test-requirements.txt
Remove unused import