Fixes to the class loader
Added some tests