Barium titanate ground- and excited-state properties from first-principles calculations