implement simple serialization of script