Performance and command line update

I added automatic image resize so that it can run on really large images in a timely manner. I also fixed up the command line version so it uses argparse and has some prettier output.