Implement smarter case pretty-printer. Resolves #165.

Improvements welcome.