Adding a `compact` method is a good idea, I'll do it.  Not keen on making the methods null-safe, I think we should fail horribly if a caller tries to remove a null dir.