Some fixes to linalg code, some movement of code.  new tests