Document tracking

Introduces window management. Every Document has a Window. Document staling is scoped by window.