Switched to argparse from optparse

The optparse module is now deprecated as of 2.7. This should have the equivalent command line functionality with minor changes as to the syntax of the command line arguments.