Rewrite docs for context locals, request contexts, and app contexts

Closes #1151.

The following is an incomplete draft. However, I wanted to get comments immediately, in any case anything was severely wrong.

The doc should be updated to include:

- [ ] How context-local objects in Flask are implemented
Wrong headline-level, use ``----``.