moving code to deploy.rb, adding new tests