finalized support for aliases in index templates

- adapted existing PR to updated code
- resolved TODOs
- added more tests (including REST test)

Closes #1825