Fixed scrollRectToVisible in CPView

Earlier it only worked correctly when the receiver was the document view of the clip view.
Added test case.

I have also converted the test case to [cocoa](http://mini.carlberg.org/dev/TestScrollRectToVisible.zip)