I love it when people go so far into the weeds to solve a problem on their own and then document the process for everyone.
I learned a lot from this writeup, and really enjoyed the read even though I know I would have made it about 10% of the way myself and chickened out and just bought a different product in hopes it would solve the problem.