Updated __main__ to use optparse