Issue #1071 - Ensure that Documents always have a non-null Window.

Turns out that documents without a window `fail!` a lot, because we need the `cx` all over.