added class-__destroy, refactored a bit, updated docs