Split up y_svar, added tests, and added support for 2D arrays.