adding TTL support and tests

@sectioneight mind taking a look?