Tweak Job Scheduling code layout.
Make estimate command somewhat more robust.

Fixes #349: Director crashes on estimate command of Copy Job
code cleanup to comply with pep8 and enable static code analysis, passes flake8 check now.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>