Change Script class and use as_json fixes #11