Refactoring.

Refactored following:
* Variable names.
* optparse help strings.
* Function names.
* Function arguments and return values.
* Conditional branching.