Add precondition check for modules to check their environment before loading.