Document properties

Fixes #3202.

Also:
- Makes the password prompt styles more reusable (was needed for usage in the document properties dialog).
- Fixes a bug in the secondary toolbar where clicking the Open button (and two other buttons) would not cause the secondary toolbar to close (was needed to make sure that the document properties dialog and the password prompt dialog cannot be open at the same time).
- Caches the dataLoaded promise so we can easily reuse it without doing a new request (as suggested by Yury; he will change this in a later fix that he has planned).