Added more error checking and implemented local module loading if exists. Remote loading takes prescedence if exists.
Fixed package module loading and added module `core` to the package.