extract replace_path_consts() utility
make autodetection of WP files in a subdirectory work in more cases

fixes #929
behat: allow correct grammar
Merge pull request #980 from wp-cli/fix-929

Fix #929