Made major changes to scripting such as scriptfactory for multiple scrip...

...ts