srm: Refactor Scheduler

This is the first iteration to clean up the Scheduler class. The
patch mostly addresses logging and locking issues, and also replaces
a number of chained if-statements with switch.

Appologies for auto-reformatting, but the existing indentation was
too inconsistent to work with.

I deliberately did not make major changes to the logic or error
messages. That will be done in subsequent patches.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Patch: http://rb.dcache.org/r/6199/