Clean up chat code; ensure names are sensible.
Minor changes.

I tried to use angular-ui's validate module, but it messes things up!