Fix editor dirty confirm leave.

Use $window instead of window. Use the jQuery element of $window to
bind listeners. Fix final location after modal confirm while properly
retaining browser history.
Rename set button to close in editor options.
Fix parsing config when it doesn't exist.
Centralize common values into a parent controller.
Add user to gist URLs and handle redirects.