Move `deploy` code to zpm module

This minimizes the amount of code in the `deploy` command wrapper
function, and moves all of the logic to an API function in the `zpm`
module called `deploy_project`.

TODO: Break up the `deploy_project` into smaller chunks and write tests
for it.

This is just the first in a series of similar refactoring/test jobs, in which primary goals are to 1) increase test coverage and 2) build out the api functionality in `zpmlib`.