events.js: Compile fixes

Signed-off-by: katlogic <kat@lua.cz>
Add buffer.js

Signed-off-by: katlogic <kat@lua.cz>
Coalesce lets

Signed-off-by: katlogic <kat@lua.cz>