Mixxx patches

Lots of fixes for merge.  Please review the comments I have added to the code on git hub.  A couple of these extra fixes need a good review.