Fix race in JS that caused multiple connections from one page.
Simplify server.py.