Implement genCacheTtl(res, origTtl). Allow override of TTL based on res.

For issue #20
add travis
Merge remote-tracking branch 'origin/pr/22'
don't bother setting keys if ttl is 0
Update version