Introduce support for mocking command output

This change rewrites FakePopen to permit registering commands and
synthetic output such that client code can call subprocess.Popen() and
receive required output without actually executing commands.

With this change, it is possible to mock most of the output
require during a packstack run.

Change-Id: If81f71cfe89a61e25fb62c97ed5b3759039a0bfb