Enable code highlighting for JS code

Reworked the code examples a bit to allow GitHub to provide us with a nice and shiny colourful code blocks. I had to change the md syntax for the code blocks so if you prefer writing them the previous way (with indenting) I am fine with it.:)