Mostly refactors functions onto boards prototypes
Mostly refactors functions onto boards prototypes

Also moves some logic into square and cleans up some repeated
logic.

jphoenix86/chess_trainer,jphoenix86/chess_trainer