Use partials to eliminate duplicate view code.

Fixes #4.