Replace optparse with thor