Migration from argparse to optparse
resolve #22
Put all the code from previous commit