Some blending fixes and code cleanup

1. As discussed on #qgis, the first commit is for QPainter::CompositionMode to be used in all internal blending variables and functions. This cleans up the code significantly and brings it into line with how label blend modes currently work.

2. Fixes a small bug causing labels in atlas prints to behave erratically when a blending mode was applied.