Add some very minimalistic testing infrastructure.
Move argc/argv adjustment later in main.

We would print a broken argv[0] in some cases before.