Added comments to exported functions.

Fixed potential problems in up- and download functions where a TCP connection could stay open previously after an error.

Extended the readme file.