Refactoring

Perhaps I'm confused about the indentation scheme being followed, but it seems like client.js is in need of some refactoring to normalize this. If that's not the case, it would be helpful to have an explanation of the coding conventions used in the JS. Thanks! :)