Rewrote DDS handling for better error messages

Returning only 0 all the time was getting boring. So now DDS handling
is its own class (which cuts down on code size since it's not plain C
anymore), and errors are reported properly.