Major rearrange of the documentation.

This PR implements the changes proposed in #565, basically it's a reshuffle of the docs to make them more logical.