Classical and quantum algebras of non-local charges in σ models