Remove unused #define's
Convert last(?) enum's to bitshifts
Merge remote-tracking branch 'upstream/master'