fix old IE and stricter jshinting
Fix build
Add hasLayer tests
Make GridLayer methods safe to call pre-setView