separating result formatting functionality from _assert()
comment() produces json result

- all TAP output is formatted in a single function
- fixes bug with exitCode == 1 upon encountering comments