Finalized support for aliases in index templates

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

Closes #1825