Slightly refactor argument parsing.

It works, but I am not done yet.