Add ASTIndexBy

This is a naive implementation that doesn't make any guarantee to what happens if multiple elements have the same return path.

Closes #16