Refactor

This used to look like a bash script that was translated to python. Hopefully it more closely resembles a python program now.

 * FIX: critupper and critlower now carry different meanings (as specified in their --help messages). Previously they were equivalent.