Add 'project' functions in preference to using range/slice functions -- this way, we can construct the range and slice objects in Python, and then pass them along / keep track of them appropriately. On the downside, it does mean that the EXPORT_DENSE_MATRIX_CLASS macro definition grows by about 30 lines. Ugh