Add tests based on examples in the spec.

This was intended to close #2, but I decided that it's not worth the effort. These tests are fine; they might as well be merged in, but it's not worth adding tests for all of the examples. There are too many, it's tedious, and most are redundant from a testing perspective.