Sramp 507

https://issues.jboss.org/browse/SRAMP-507
There's a lot of duplicate code between here and DeployCommand.  Pull it somewhere common?