Add CopySelectedReferences (refactor the latest that was found in the TWB SVN repository)