Added array casting to Elementwise and Aggregation like operations.

Fixes #82.
This is doing validation as well as casting, so I'd rather it were called something like `ensure_array`.

And for some reason it seems like it might sit better as a module level function... not sure.