tests: Clean up and reorganise everything.

* Clean up and reorder the imports.
* Add extra new lines before if __name__ for legibility.
* Add a docstring to every test.
* Split up the tests in its own classes, one per method.
* Every test we run now has its own method named after what it tests and
  a docstring.