Added the PullSnapshot command tests. Did some refactoring to some commands to remove duplicated code.