improve ccmean* functions

- don't try to compute means of nan slices, which leads to annoying warnings
- mask the result of ccmeans where all data are nan
- add nvalid and nanmask methods to Cast for implementation of above