Refactored function to use mat64.

Changed most of the actual matrix operations to use the mat64 library.
Added Mac and IntelliJ files to gitignore.