Enhanced command line parsing closes #16

Removes side effects