Reporting jsErrors backtrace for format json and plain

- adding addJsError for public/proxy api.
- Initalize jsErrors with zero and increase on error instead. Adding error to jsErrors for formatting later (plain) and this will also fix so that jsErrors will not be empty when reporting in json format.
- formatting js error with backtrace when plain-format