Add separate update flags for context and view

While using one flag, the single flag will be updated in
clean_context_json or clean_view_json(whichever happens to be called
first) and then this flag will be used in the branch in the other. This
is not the desired behavior. Each clean_*_json method should make up its
own mind whether to update the count and not be affected by the behavior
of the other.
Add full tests for QueryForm