Implement more efficient TTL querying

There's no need to hit etcd for every single key we need a TTL for. This is
the case when performing recursive queries, since we already have the keys containing
TTL data in the list of nodes, we just need to filter them out.

By sorting the list of keys first, we can do this in an iterative manor.