Buffer emulation complete

Usable as is.

Known issues: Threads don't exit gracefully.