Make sure to reset the lastActivity timestamp after a monitor restart; fixes #27.

Also add a number of unit tests for client-side idle monitoring logic.