Added array casting to Elementwise and Aggregation like operations.

Fixes #82.