Cleanup the common/macros.h header

After merging the macros.h header from decode and encoder, it contained quite a bit of overlap, some amount of unused macros and was generally quite unreadable. After this patchset (each patch fixing one individual issue at a time, with detailed explanations and comments in the commit messages) it should be cleaned up somewhat.