Move cli option code into own function.
Had to remove nategood/commando library as it doesn't work with PHP 5.2.x