Added Textures

Added Textures! Fixed a memory leak and cleaned some code up.