Add functions for converting a piece to a char and back