Common generator script logic moved into Generator as as_script method.