Speedup matrix dot product using numpy's dot

Use dot() and ensure unittests still work.