CommandRunner refactor

Fixes #1879