Add unit test for flatfile

also, made flatfile read matrices saved from matlab