start refactoring to separate istream handling from jsonc parsing