Add feature to preprocess chunks prior to testing & sending.

Add a feature that allows for preprocessing each chunk before making requests to the server. This is useful e.g. for client-side checksumming, encrypting or similar processing.