Refactor the behavior of handling for matches at a point into its own function and pass that into a function which does it for each board position so that we don't need to rewrite the loop for each one