Tensor Categories and Endomorphisms of von Neumann Algebras: with Applications to Quantum Field Theory