Refactor 2d

Ready for merge.  Lookin at you, Caswell
if you want to allow ragged edges, you will need to square them off some how.  I suspect padding with nans is the best option. 

```
def squarify_ragged_data(data_list):
    """
    Takes a list of N arrays of (possibly) varying lengths
    and returns an Nx(max length) array.  The missing data
    points are replaced by nans, the data is right-aligned.

    This assumes that the pitch in each array is the same, to
    turn arbitrary (x, y) lists in to f(x, y) we need to use
    interpolation.

    Parameters
    ----------
    data_list : list
        list of array-like objects

    Returns
    -------
    data_out : np.ndarray
        A rectangular array padded with nans
    """
    # get the length of each data entry
    data_lens = [len(_) for _ in data_list]
    # make output array of right size full of nans
    data_out = np.ones((len(data_list), max(data_len))) * np.nan
    for j, data in enumerate(data_list):
        data_out[j,:len(data)] = data

    return data_out
```

Should probably go in core or something