Add validation to startATMode, post and get

Added validation and retries to the startATMode handshake as well as
timeouts if the handshake fails entirely.

Also added a disconnect method which disconnects TCP connections and
placed this at the end of the get and post methods as these are already
using the Connection: close method.

Finally, made it so get and post examine the return code from their HTTP
requests and use that as the return value, using negative numbers for
error codes.
Add timeout to readResponse and fix validation of content length

I've added a timeout to readResponse as I experienced a few occasions
where the server died mid-connection (perhaps is restarted) and the
DigiX hung forever.
I've also fixed the validation of contentLength in get (and added it to
post) as the string-based comparison didn't actually work for me.
Merge pull request #15 from jdcockrill/master

Multiple bug-fixes, primarily for stability
Merge pull request #16 from digistump/master

merge of new master updates into branch