refactoring work towards saving in .json format (whilst still being able to specify .rb format for legacy tests)