Added cubix texture mapping; cleaned up texture mapping code