Midje tests

I added some unit and integration tests using Midje.

I may have gone a little overboard, testing a bunch of private functions.  I did discover a few oddities, which I mostly marked as TODO or NOTE in the tests.  Take a look (or we could discuss them here).

There are some integration tests which Amazon's delay in executing make infeasible, but there are a fair number that work.