Added destory functions, empty trash, updated tests, other small refractoring