Refactoring the loading of matrix support.

Now, we can load other file types.