Fix Plex rules

 - Fix the regexes that match to Plex rules
 - invert the order of `$file, $directory` to match previous usage
 - unit test.