Teardown the testbed before setup, in case previous tests failed.

npm doesn't seem to run "posttest" scripts if the tests fail, so
I was ending up with a dangling testbed that was preventing setup
from running.
Added DateRange class.