Factors patterncomp2re, for one pattern component
Adds memoize1 decorator for pattern2re()

This uses either functools.lru_cache() (Python 3.2+) or a simple dict.
Makes recursedir() faster

pattern2re() returned a regex that matches the requested paths. Now, it
also returns the start directory from which to search (so that a pattern
of 'some/directory/dir*/*.txt' can simply list 'some/directory' instead
of recursing from top), and an intermediate pattern so that
'some/directory/impossible' won't be listed (we know that no path under
it will match the full pattern).

Needs more tests.
Makes AppVeyor use shallow_clone

[skip ci]
Merge branch 'optimize-recursedir' into 'master'