Extracted 'spawn_command' into its own action module

Moved spawnCommand into its own module and made the tests a lot DRYer. -41 lines, yay!