Fix #3 - before downscale check schedule and retry queues

For for issue #3

I have added checks for the schedule and retry sets so the Scaler won't downscale to 0 and leaves the process running until Retries or Scheduled jobs have a chance to start.

Includes tests and new way to make a unique database connection for tests.