Added recursive ability to copy commands and added unit tests