Documentation

Adds docstrings and a first draft of a user manual.
This should be a separate issue though.