Add lz.node, refactor event sending code