Code review comments.
  - removed needless nested function
  - fixed potential bug with mutable value of keyword argument.
- Fix incorrect usage of query variable.
- Fix potential bug with mutable keyword argument
Update docstrings.
Rename "q" to a more meaningful "query".
Merge pull request #4 from yola/fix-mutable-kw-argument

Code review comments.