Fix const correctness in parameter.
Refactored TextureManager a bit.