refactors querying for assignable users

It is still not as fast as it should be. Even after refactoring it takes 1-2 seconds before the answer is calculated (used to be 5-6).

It might be desirable to switch behavior depending on whether all associated objects are already loaded and how much of them exist. When they are all loaded and when there are but a few it might be faster to do this in ruby itself.