Adding test for app; verifies successful cmd run. Refactored command.factory

Signed-off-by: Damien Le Berrigaud <damien@pivotallabs.com>