buffer: fix invalid write buffer.
tests: remove event tests.
tests: update buffer test for new api.
rpc: remove legacy include.