Refactor a few bits for Capistrano 3.1