Test ideals via algebras of $p^{-e}$-linear maps