add a method to return an object in Cursor.php

It would be great to be able to return an object in many cases instead of straight JSON.