Permutation classes and polyomino classes with excluded submatrices