Add layer-level-changed event and add $.indexOf polyfill