Refactored loading core modules. Fixes #29