Massive refactoring:
Refactoring done for the WIC and LibTIFF backends.
Minor other refactoring and stylistic changes.