Refactor Linalg tests and make them pass on FreeBSD 6.2/perl 5.10.0.