Added functional tests for the examples.

These won't run unless you pass the --runslow argument (which the Travis
config uses).  They should help us make sure that no pull requests or other
commits break any of the examples.  At least not in a way where the example
raises an exception.