Modify to use Thor for command-line interface.

This is getting rid of all of the bash scripting.
Adding some description and commenting.