Refactor, make most of board functions const
Improve const-correctness