Extracting the heroku command logic and making it testable