Make "mean" and "sum" methods work without a mask

Also add a convenience length function
Fix bug in length method.