Added a context manager to capture queries while testing.

Also made some import cleanups while I was there.

Refs #10399.
Fixed #10399 -- Tested that o2o field updates are not constrained by an inner query.
Import `CaptureQueriesContext` from its original module.
Add a BinaryField model field

Thanks Michael Jung, Charl Botha and Florian Apolloner for review
and help on the patch.
Added support for serializing BinaryField
Add introspection support for BinaryField
Reordered methods in database wrappers.

* Grouped related methods together -- with banner comments :/
* Described which methods are intended to be implemented in backends.
* Added docstrings.
* Used the same order in all wrappers.
Fixed #18130 -- Made the isolation level configurable on PostgreSQL.

Thanks limscoder for the report and niwi for the draft patch.
Fixed #19962 - Added a note about SESSION_EXPIRE_AT_BROWSER_CLOSE and browsers that persist sessions.

Thanks David Sanders.
Fixed #19917 -- Added microseconds in default TIME_INPUT_FORMATS

Thanks minddust for the report.
Fixed #16888 -- Added microseconds in localized input formats
Fixed getting default encoding in get_system_username

Refs #19933.
Fixed #19177 -- Better layout for admin login form field labels.

Thanks goes to void for the comprehensive report, to Pedro Mourelle for
the fix and to Bryan Veloso, Łukasz Rekucki and Claude Paroz for the
review.

This fix includes the following changes:

* Modified layout to top-aligned labels.
* Added 'air' for inputs (the padding was really needed there.). It
  adjust good to zoom in/out.
* Removed float attributes from label and inputs in login form.
* Removed useless text-align property.