Run single detector

This is the implementation of a long-standing feature request: #13.

During the implementation, I came across some design issues with the current code. I'd like to pick these up next (see FIXMEs and TODOs in this pull request).
All of the whitespace changes from above don't belong in this PR, do they?