Refactoring: More general approach for option handling.
Update documentation.