Move texture cache inside the resource cache. …
This is prep work for support texture cache updates and frees, in particular for canvas animation. This also tidies up quite a bit of the code, reducing number of params in function calls.