Modular cocycles and class field theory