updated to use MySQL. saves submatrices as files.