Fix example code bugs, clarify comments.

Also added syntax hi-lighting for GitHub.