Heavy refactoring, added "delete" operation, added XML docs.