contents.js wrapper for contents service

This is PR #6671, rebased because it's a blocker for the text editor components, and @fperez asked me to make that high priority. So far, I've just rebased, I intend to test it and fix things I see.
Given that we'll be changing the callbacks not to directly return the ajax calls (see https://github.com/takluyver/ipython/pull/13), I think returning the ajax promise would create potential for incompatibilities with other Contents implementations that don't use $.ajax().  If the caller wants a promise, can't they create it themselves?