Lazy evaluation

This is the other half of the resolution to #37.

Fixes #37.