Many changes to the lhttpc client

This pull request includes all the changes that we have done to the client during the last months. I rebased against the master and should be ready to merge.

Before merging, it could be a good idea to tag the current version, as it is suggested in https://github.com/esl/lhttpc/issues/30