Move validation beginning

A major restructuring will be necessary, probably creating a Board
class to make it easier to invoke board functions on different boards.
An alternative would be to do move validation through undoMove()-like
functions, which is simpler but perhaps ultimately less useful and
slower.