Internal refactor to master cmd

First-pass breakup of logical components into function calls for general
maintainability, refactorability, merge-conflict-avoidance, etc.
Agree, I can fix this so the all-in-one doesn't use multiple instances.