Add query->clear().

I found a few duplicated blocks of code related to clearing query state
when subqueries are created. Having a function will help prevent code
getting out of sync in the future.
Rename clear() to cleanCopy().

It fixes an awkward name and makes the cloning part of the function
which I feel is cleaner and easier to use.
Add basic tests for cleanCopy().
Merge pull request #4485 from cakephp/query-clear

Add query->cleanCopy().