Open new windows before creating new notebooks

Point the new window to the target location when the AJAX response arrives. Avoids the need for synchronous requests to beat pop-up blockers, and more cleanly separates the contents API from the UI.

Companion of #6854, which does the same for terminals. See also discussion in #6849.