Refine O(n*logn) maximum-subarray implementation, and add an O(n) implementation.