Initial Digest Authentication work

Added check of WWW-Authenticate header for required security method
Added code to generate a Digest response for the Authentication header
Added utility code around the above.
Added support for persisting authentication requirements between requests (E.g. nc value)
Fixed type bug in split call
Merge pull request #540 from adamfowleruk/master

Fix for issue #538