Fixed XSS vulnerability by sanitizing fields when adding via Javascript

Fixes issue #330 where someone could have a username or other fields that cause XSS attacks. I'm sure it's not the only way you could do XSS attacks, but it fixes one of them.