Added unit test to make sure that ${index} tokens are filled in properly.
Fixed bug in index parameter expansion inside ResourceType.