Abstracts much of the polling infrastructure into the RESTPolling block

Signed-off-by: Oren Leiman <oren@neutral.io>