Add a withIndex method

Julia does not have an inbuilt function similar to MATLAB's max/min which
returns the max as well as the arg max. The function withIndex is a replacement
for that.

I still need to look to see if this function can be made more efficient.