Add tests for blaze.linalg module and fix bugs

To get more familiar with the code, I've started writing some unit tests (beginning with the linalg module) and found a few minor bugs along the way.