Revise and improve publishing logic

This PR refactors the publishing logic by moving it out to a `Publisher` class. It also adds the possibility to mark a page as `published: false`, as already possible for posts (thus this supplements and closes #1080), and a new `--unpublished` flag to render such posts and pages.