Reformatted code because it was inconsistent and not pythonic.
Initial Python 3 port, command arguments are working now, though more
investigation should be done into why string arguments come in quoted.