Call relationships out of the singleton
Properly limit queries by relationships

Resolves #230