Refactor GimpJSONEncoder