reformat README for github
fix shutdown detect

now we have no invisible window, adjust shutdown detection
fix duplicate ws
fix a few memleaks