Linear algebra algorithms in pure javascript