Syntax highlighting for code blocks

Made use of [Github syntax highlighting](https://help.github.com/articles/github-flavored-markdown#syntax-highlighting) for code examples.

Also edited some js coding style matters.