Add get_indices function and cmd-line args

This allows simpler retrieval of indices in a sorted list, both as a module and as a command-line option.

Test added :smile: