Added a deep-cloning method. And tests for it.