Refactor and add board accessor functions.
Clean up datastructures and tests.