Add support for static textures

Loading textures from an array will be useful in high level libraries, so that we don't need separate shaders for images and solid colors. It allows for programatically generating textures, such as gradients. And it's an important first step to multi pass rendering. 

Changes to existing code are minor and should bring little overhead.