Deprecated layer functions in viewer; additional cleanup.
Cleaned up tileCache code.