Adding matrix functions from 2048D
Adding Matrix type constraint template; adding countEmpty; adding hasPair