various fixes

two fixes:

1. make it optional to query for machines and leaders in the constructor
2. add ttl option to testandset

the reason for (1) is two fold: the service might not be up yet (who knows, and how are errors handled in that case?), plus its bad practice to do these kind of stuff in the constructor.  the constructor should initialize and wire things up.