#168 Added support for module systems. A less invasive implementation than sakabako's commit 5459bf6.