add capistrano and convert app to use postgres