More caching and bug fixes

-More GLSL uniform caching.
-Added debug checks for background and sprite loading.
-Better error messages.