Added mul, docs and test and fixed a number of bugs.