Refactored, fixed and cleanup several thingies
Reverted some test changes