Javascript maze generator