add optional debug output, better js matching and git rule