superficial review

Hi Shai,

I started with the review of the server (I'll do the client once I'm done) and for now fixed JavaScript minor issues and two real errors. Please let me know what you think. I suggest you review my commits (and my comments to each commit) separately, not like one big diff.

I have some bigger issues that I will comment on next (I will not fix, they require you tot take a look), but I wanted to first clear the code a bit.

Let me know if you want to discuss.

BTW this is also a good test to see if the fork/pull model works well

Tal