ENH: Make edges faster, cleaner
STY: Clearer code, add dir/file checks