Improving tests, and cleanup of the dx cp code