Redmine#3279: nth() function now data container aware

I'll write the acceptance test after receiving a quick sanity check and "all clear".

Two things don't feel quite right to me:
1) removal of ``const`` from ``Rlist *rp``
2) explicit cast from ``long`` to ``size_t``

[Quick test](https://gist.github.com/cdituri/7215347)