Reorder initialization calls.

* Refactor opt checking, paving the way for separation into commands
  module.
* Do not hijack the stdout for commands, reduce clutter.