Generalise action-graph so that memory-access-type is a parameter.

This allows the existing theorem about iteration-reordering over a
single array to go through and should also allow more general memory
accesses (as when there are multiple arrays in memory for example).
Generalise again so that iteration-type is a parameter to action-graphs