Various cleanup

stripped trailing whitespace, and put code example into fenced code block, for pretty syntax highlighting on github