Refactored doppelpack detection to its own class and improved the
detection a bit.
Some more refactoring.