Refactor arg parsing to use apache cli library