Added function to determine if a module is enabled on a particular tenant
Various bug fixes and improvements