Handle braces in quotes in json message extractor

Since value data in quotes may contain unmatched braces, we
detect if we're within quotes before manipulating brace count.
Also handles nested & uneven quotes and adds specs testing
edge cases.