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).

Okay, I see the source of my confusion. `writeToIndexFile` performs async actions, but never calls `cb`. This probably needs to be something like the following:

```javascript
writeOutputToFile(root, filename, outfile, indexfile, function(err, root, sourcefile, outfile) {
  if (err) return cb(err);
  writeToIndexFile(root, sourcefile, outfile, cb);
})
```