Beautifying the code

Cleaned it up using http://jsbeautifier.org/