Cleanup of main by breaking out argument parsing as it's own function, and adding a bit of verification to them as well.