Get pre-assigned agent counts in main job query

This saves us one query per job, which in this particular case is a big
deal. With sqlite and 1050 jobs, the reduces the scheduler's runtime
from > 2 minutes to < 10 seconds on my machine.
Index suitable agents for jobtypes

This saves us a lot of manually checking whether a given agent will be
able to run a given job. Since these checks require one database query
per job, the resulting speed-up can be significant.

This is particularly obvious when there are some agents in the farm that
cannot run most kinds of jobs and will often sit idle while the rest of
the farm is busy.
Work only on running jobs by default

Queued jobs will only be queried when it is time to start a new one.
Remove check for zero tasks

When the master is under load, this check hurts more than it helps. When
it isn't, it doesn't matter anyway.
Fix syntax error
Remove some debugging logs with too much output
Add a log statetment on scheduler finish
Fix a comment
Fix JobQueue.path(() with empty name
Fix indentation
Fix typo in variable name, start oldest job first
Fix getting all relevant jobtypes
Remove superfluous newlines
Merge pull request #275 from guidow/optimize_scheduler_again

Optimize scheduler again