Update mazegen.js

I am deeply sorry for not knowing how to properly contribute to this project, please see issue #159.