Futher rework from PyPNG into PurePNG