Backport, test and generalize ReplicantPollResource from downstream libraries.

This class makes it easy to setup polling for replicant based systems.
Rename ReplicantSessionManager.poll() to pollPacket to make it easier to sub-class.
Introduce ReplicantJsonSessionManager as all downstream projects use json as their transport layer.
Use built-in mechanisms for deriving a default url for the web poller
Record the latest change
Make setBasePollURL nullable so it can be reset to default
Extract a helper method guessContextURL()
Remove pending flag