Add a tail operation (with some tests)

Fixes #22.