handle negative coordinates for pd META regex, add doc/* directory search trigger, various refactoring