Added global remove and some tests.
Added support for cleanup and exportsAll.