Merge pull request #774 from magcius/texdecode-cleanup Clean up the TextureDecoder and some related things