Code Cleanup

Hi, 

I haven't wrote a ticket for you (yet), but I cleaned up the code a little bit. So removed unused vars, miss spelled words, reserved js words, etc. 

I haven't run the tests, because I don't have couchdb installed. Please run the tests by yourself.

Best, 
Tony