New code to close modals (#1301)

The code before was failing because there was no open-modal link in
the situation described in #1301.  Reworked the code to make it
cleaner and fix the bug.  Removed the code that closed the dialog when
you click outside of it.  I think having the close button is enough.
Fixed the add url dialog when switching tabs (#1298)

Added code to setup modal dialogs when we switch to them with AHAH.
Fixed a bug with AHAHTabLoader where we wouldn't call the onComplete
function if the tab content was cached.
Merge branch 'new-editor-primary' into new-editor-primary-1043
Fix issue with browser confimation modal when exiting the editor, for issue #1043