Add ScriptOptions and refactor input argument parsing