fix fnmatch for newline, add tests stolen from python