libpng's complexity, Part II

I've been working on cleaning up the code for Wesnoth-TC's PNG reader/writer functionality and so far I've only partially succeeded. I cleaned the code up, sure, but I also messed up somewhere and mixed up something breaking Wesnoth-TC.

The new_writer branch is already in the Git repository but users will definitely want to use master instead. I haven't yet decided if new_writer will ever be merged back into master or I'll just throw it away.

But at this point I'm tempted to give up and try a different library for reading and writing PNG files — if I keep trying to understand how to use libpng correctly (if that's even possible), Wesnoth-TC 1.5 will never be finished.