Complete rewrite of what I had so far, going for more concise functions. Also trying to write things in a manner that makes changing the board size at any time very simple.