Implement t_deploy, and some cleanup.