Encode board state before saving. Close #5.