Changed things around to work with intermine.Query objects.