tests/test_zpm: test all the deploy things!

This adds tests for nearly all of the core deployment functionality, and
improves test coverage a lot. Previously, there was almost no test
coverage for this entire code path.