Fixes for ReduceFunction and some clean-up (new JavaAPI)

- Fixes in ReduceFunction.
- Removed ReferenceWrappingReducer. 
- Cleaned imports in PlanOperators.