Updated intentation. Fixed code styles. Addded ";" to function keyHandler to avoid packing and minify problems