added to/from json functions

Associated with ecreee training