[textures] move image wrapping functions into a separate class
[textures] expose the texture cache to JSON-RPC with GetTextures/RemoveTexture