restore-script functionality reimplemented #58
Added spec for script generation.