add tests for various primitive ndarrays and make them work

matrix multiplication was erroneous and is rewritten again