fix(rewrite): Handle formatting of json comments when adding new resource roots

Add new method addCommaToLine(args) which allows you to find a line in a file
 and add a terminating comment char at a specified offset from that line. Uses
 same methods as in rewrite(args).

Fixes #55 #57
refactor(sub-gen): Refactor error handling when writing resource roots from the component sub-generator

Fixes #54 #55
Merge pull request #58 from js1972/format

fix(rewrite): Handle formatting of json comments when adding new resourc...