Add gDebugger / apitrace debug markers. Remove unused code. Do more
aggressive caching of shader states.