Added module activate/deactivate functions and fixed reliance issues.