Refactoring of json file tests.
Can read group patterns from json.