Got logout working and fixed some client side bugs. WIP