Long polling

Periodic update, also includes some cleanup of warnings and unit tests.