Importing some stuff - Borrowing heavily from the capistrano codebase