Upgrades to postgres, removes legacy and backup files, and fixes login redirect.