Moving common query code (with just 'max-results') to a static function.
Moving common query code (with just 'max-results') to a static function.

It will be shared between common dump and other query functions.

mback2k/libgcal,Adenilson/libgcal,Adenilson/libgcal