Add using blocks when working with streams
Change autoupdate monitoring so that it does not block a thread while waiting

Add graceful cancellation to autoupdatemonitoring
Merge pull request #61 from kerams/master

Refactorings