Fix a handful of bugs, implement wc.

The implementation of wc isn't actually correct, but exercises a
handful of features.
A few fixes to the wc implementation.

character and line counts are correct now. Words are still wrong -- we
need to be smarter about detecting word boundaries.