Paolo: thanks for working on this.
i gave your patch a quick glance for the most part it seems good – although we should preserve the one arg version of CoreContainer.remove for back compat.
as far as tests go: i can't remember off the top of my head how some of hte other CoreContainer tests work – the existing ones may all be Jetty based (using CoreAdminHandler).
We should probably overhaul the SolrTestHarness to be more "multi-core" friendly, but one thing you could probably do for now, is let the TestHarness create a core, then use getCore().getCoreDescriptor().getCoreContainer(). from there you can create/destroy cores to your hearts content (and verify that the data dir goes away when it's suppose to, and stays arround when it's suppose to)