Changes to Texture API and some internal changes.