Preparation for SRB Gerrit review

Please use this PR for review, or the branch to push any changes.

We'll squash any commits later on into 2 target commits.
Each time I see a 'del' statement in Python, I am afraid. Maybe because I know little of python internals, but maybe consider using _attached_devices.pop(volid, None) instead. "del" + synchronization stuff == huehue..