Tensor Network States and Algorithms in the presence of Abelian and non-Abelian Symmetries