For anyone interested I modernised the Three.js part of the marker based augmented reality library AR.js into a separate library called THREE AR. You can see it here https://github.com/JamesMilnerUK/THREEAR
I spent a nontrivial amount of time fiddling with arjs a couple of years ago so I know how disorganized that codebase is. congrats on wrestling it down but I'm curious why? what did you end up using the marker recognition for? I was trying to build a product around but ultimately decided that the markers are simply too awkward.