Migrated you to argparse instead of optparse

Hey, updated your code to use argparse instead of optparse, which according to the documentation is deprecated. Moved some of the __main__ code into a couple of functions just to clean it up a bit. For some reason this seemed to fix the bug I had with the password not being recognized when the --entry option is passed. I have no idea why!!

Thanks!
Scott