Finalized support for aliases in index templates

- adapted existing PR to updated code (post #4920)
- resolved TODOs (bw compatible serialization etc.)
- added more tests
- added docs

Closes #1825