[WIP] Implement array methods

Implement ndarray.sum() and ndarray.flat as array methods.