Modified main module so it doesn't set things up more than once per process, even if installed in multiple places.