Make renderer and textures not global.

Made a mess with this one. Next commit will be cleanup for this one.