Limit only subject implementation

This code pushes the UI filters through subject filters as limits in the SQL, so we actually reduce the number of rows fetched, instead of having to do it in the python. This is particularly obvious for a search w/ more than one subject limit: the intersection is quite small in many cases, but the search became longer.