A bug fix & an optimization

- Move the try/catch around the JSON.parse() into a separate function so the main one can be optimized.
- Check for an object result, not just a failure in the parse.This handles the case where bistre is handling all output from a process and you do something like `console.log(3)`. The bare number is valid JSON, but not a structured json log line.
- Check for the existence of the name property before trying  to call .replace() on it. Revealed by the previous case, though not strictly necessary now that we short-circuit. Still, this is safer, just in case bistre ever gets valid json without that field piped through it.

Sorry about two PRs in short order! I tripped over this immediately after you landed the previous one.