Optimization to Maze js

Removed the use of function setNodeIDs
reduced run time by at least n*k where k may not grow linearly.