Improve stash and checkout for ignored + untracked items

Fixes for #2240 and #2290 

* Stash and checkout will now treat directories that only contain ignored items as themselves being ignored, instead of grouping them with untracked.
* They will treat empty directories as untracked items.
* They will not touch Git repositories that are untracked and contained underneath the parent repo, even when asked to remove untracked and/or ignored items.