Missing var (len is leaking into global scope).

Lets try to get this branch merged first and then I will add jshint file and clean up all the style and consistency issues with defining variables at the beginning of a function.