Refactored scripts to run via command line

Should also be compatible with foreach.py