Stylized JavaScript code to follow idiomatic.js guidelines.

I have re-stylized the JavaScript code, sort-of following the
guidelines of 'idiomatic.js'. The number of lines has been drastically
reduced.

I am not completely happy with the end-result; I think it's slightly
illegible. However, this tends to be the de-facto standard of the
community so I'm assuming most "real" JavaScript developers will do
just fine with it.