Ported rollyourown argument parser back into main handling code