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.
The only distinction that should exist in the contents service between notebooks and other files:

- notebook content is unpacked JSON, not a text or base64 string