Move location to matrix out of utils and into its own file.