New summed variable syntax

This implements the new syntax for summed variables, it's good to go from my side. It's based on the `index_refactoring` branch, so merging it after that branch should be possible without problems.