Refactor options parser to own class.

Refactor options parser to own class.