Implement database methods and rewrite deploy.rb as remote.rb