Release 0.4.0

Fixes #60.

Once this is merged I will tag the release, and do the PyPI and Read The Docs uploads.