Reimplemented the 'reduce' operator

Hi,

I reimplemented the 'reduce' operator. The improvements are as follow:
* As I mentioned in #423, 'reduce' should throw an exception when applying on an empty sequence without an initial value.
* Now 'reduce' does not need a 'takeLast' operator, and should be more efficient.