[fix major] Fixing missing event handlers and small refactor
[test] Making simple handmade tests for the lib