Looks like I have figured out how to do this.
I feel really uncomfortable with changing this mod without any tests. Thats why I'm going to increase production quality of this mod.
Do you have any familiar unit-testing framework?
If not, I'll use
lunatest.