I finished reworking the mod for now and uploaded the source code on github. However, this is my first time using github so it might take a bit of time for me to respond to any requests.
I plan to continue to work on the mod in the next days so I did not remove any debug code. Sorry if that hurts the readability.