better array support in -r and -o

One can use "[2].a[3][5]" to access specific body parts. Also added
tests.