Preliminary checkin.
Fixed tests so that seeding and teardown are guaranteed to finish before tests start, and after they finish.
Refactored the seed module for testing so that is uses the Q library to run tests in sequence. Also consolidated a lot of common functionality.