Changes to add containment to modules and further bugfixes and enhancements