more test and small change to make code more clear
add eos? to stream interface and handles eos in merged stream