Allow arbitrary python code in kernel field.

Serialize to a standard array when exporting for MATLAB.

--BRJ and CAR