I don't know what all this code is for but you'll need an automated test case that shows why it's needed.   Hopefully something that can reproduce the problem you are trying to solve without loading the BidiSupport plugin.