JJ's initial work on converting dophot.pl to Python.