Adds ttl support.

Fixes #1