Fixed some typos and bugs, wrote some more text, generally cleaning things up.
Merging goal selectivity branch into master.