Imported: code from json_applet package.