UPDATE
This was just a quick experiment to see if I could do this using some ideas "stolen" from StackOverflow. Since then, I actually started to implement the code for my use case and there's a better solution On my Github and this article will be updated to match that in "the near future".