Enable syntax highlighting for code snippets.

Also improved formatting and fixed typos - please review before merging.