Fixed broken code. Refactored a lot into functions. Put grid cell and path initializations in the same loop. Added extra boolean settings. Refactored HTML settings to be more customizable.