sys.argv no longer needed and other argument parsing improvements