added stream timeout support, comment, indentation, copyright to 2014