core: use CommandMocks for common mocking bits

Change-Id: I9493d1103f4b9366eca9a45d5c8cc10d45cf1494
Signed-off-by: Roy Golan <rgolan@redhat.com>