more consistent api naming for read/write of script; fixed bug in setScript