Orthogonal bases for transportation polytopes applied to Latin squares, magic squares and Sudoku boards