Add commandline handling to TestDevice.
Made argument order more consistent.