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.
Wait, no, this *isn't* notebook specific. We describe files in general using a JSON model - [see the contents service IPEP](https://github.com/ipython/ipython/wiki/IPEP-27%3A-Contents-Service#contents-api). The only differences are the `type` field being 'notebook' or 'file', and the `contents` field being a structured JSON object rather than a string. But I think this is still valid as is.