Added referencing to textures.

If you try to load the same texture twice, it will instead use a copy of
the already loaded texture.