Split re-usable parts out of ContributionsQuery

Change-Id: I8dac314453d1bdffe076007a57cb8b1aa7242431
Merge "Split re-usable parts out of ContributionsQuery"