Dynamical Systems, Cocycles and Cohomology of Action Groupoids