return global events from require(['base/js/events']).

In master, it is impossible to load code on IPython events without setting timeouts.
don’t use events !== undefined to signal page ready

it will always be defined
Trigger app_initialized event *after* the 'global' IPython object is initialized
preserve backward-compatible $([IPython.events])
don’t load custom.js in page template

we are loading it in require, and don’t want to load it twice
fix docstring in events.js

example shows registering a handler, not triggering an event.
note loaded, unused dependencies in require
use global events in js tests
Merge pull request #6119 from minrk/global-events

return global events from require(['base/js/events']).
mv services/notebooks services/contents
rename notebooks service to contents service

minimal functional changes, committing because tests are passing.
teach contents service about non-notebook files
teach tree view about non-notebook files
add support and tests for uploading and saving regular files
test creating a directory with PUT
contents service review

- missed some s/notebook/file/ in docstrings
- manager doesn’t sort contents
support deleting empty directories

can’t copy directories
use contents manager to handle redirect of /notebooks -> /files

avoids 404 on /files for visiting a nonexistent notebook
updates per review

a few more notebook mentions in docstrings,
and inappropriate use of setdefault.
move `/files/` redirect to base handlers

and reuse it in /nbconvert/html/…

closes #6137