Made some code testable; PrepareMatrix() method extracted in Board.cs