move algos to board.js; add testing lib