add helper for accessing and removing indexes

- Add tests to validate behavior.
- Fix a bug when reporting removing of an index to observers.