Make polling interval configurable.

First patch for review comments.