Fix several JS crashes

It helps to know how to code. Stupid Monkey!
Rename auth variables

USERNAME and PASSWORD conflict with usual shell vars. Use something more
specific.