json doc generator now generates _index.json as it creates files.

`generate.js` now accepts `--output=<file>` which `tools/doc/json.js` uses to write the output. If output file is missing then it executes callback. This was required to get the directory for new `_index.json`. Ideally, I left it for you to decide what to call this `_index.json`. There is already an index.json file which should not be generated at all. Additionally it sets title as first heading node text if applicable.

TODO
* ~~Add exclude files to avoid generation of `index.json`~~
* Dependency map in Makefile (if subchapters like structure is required).

this error handling should happen in `doJSON` -- including the `err` argument that `writeToIndexFile` takes.