Add labels to code examples and minor grammar edits

Prior to this commit, readers could not determine where included code
samples came from. This commit adds labels to code segments and makes
a few minor grammar edits.