add a lock implementation and use it in fromStream()
limit echo example to five lines
remove extra dependencies for examples