Shuffle the code around and make use of docstrings to conform to
the newly introduced coding style as described in `HACKING.md`
This commit also introduces docstrings describing each source file.
These messages are mainly useful for development. This part will be rewritten
once we introduce structured logging. For the moment this will just add noise.