refactor DB module

- db.cursor is now @property : db.cursor() --> db.cursor
- db locking issue : checkfunction(item) --> checkfunction(item, db)
Merge branch 'dev' of https://github.com/sooop/w into dev
Merge branch 'master' of https://github.com/sooop/w