sophia: implement index:random(), closes #509