move to streams2 interface
add basic test harness
expose close frame code and reason