Various changes

* Add comments (especially in JavaScript code).
* Return, and deal with, application/json, not text/plain (but always UTF-8).