Move scripts' arg parsing to scripts/

Also add rudimentary tests for them, and make every file touched PEP-8 clean.