Implement proper tests plus global mod table

Implement first proper test for the project.

Additionally implement global module table shared between processes. Improve code overall. Based on previous branches, hence it has also #2 and improved, not dependent on Data.Global, #1.