Fetch all user shares in one query

This will fetch all user shares in a single run, not user by user as
done previously. Saves one query and can possibly increase SQL execution
time.

Addresses #246
Merge pull request #255 from TheSerapher/issue-246-fetch-all-users

Fetch all user shares in one query