Gym: unfinished changes, using new JSON output