Tests for #20

This seemed more useful for debugging #20 than just pasting in more code. Sorry it took me a bit.

Works fine if you open the writeStream before the `.getAttribute()` call. Opening stream inside `.getAttribute()` pauses the entire program to end.

Haven't been able to figure out why yet.