backend fixes

* integer ids
* user_from_sid
ts/login/login.ts - rewritten Connection class in TypeScript
unregister for Event does not work properly
Fix events