Improving cmd line scanning, handling thin options in front of -p <port>. Also clean up test usage, just use if/then and [].