Added test to cover the case when cmdarg_purge erases or otherwise makes the cmdarg_cfg internals unusable, also changed the purge method to something much simpler