Version 0.4.0: Pro APIs, major refactoring due to substantial API changes

Details in the changelog. This PR unfortunately breaks all backward compatibility, but with this release I hope to stabilize it enough to finally release 1.0.0.