Moves document header into a partial. Fixes #519.