Better, more generic readOption() method.
Misc. cleanup and bug fixes.