Implemented Reduce

Sid, Harry, and I knocked out reduce today. We had to fix some problems with array type-inferencing as well.