prepare fix for Issue 11543 - multiple definition of std.regex...

...with shared library

- make ModuleInfo immutable to fix copy relocations

- use allocated bit vector for module sorting

- fix constness of ModuleInfo methods