Atom-interferometric test of the equivalence principle and observation of a quantum system in curved spacetime