Rework the way that the WP tests directory is inferred during test bootstrap, to support WP_DEVELOP_DIR

This provides greater flexibility, and better compatibility with other projects.

Fixes #5376

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8415 cdf35c40-ae34-48e0-9cc9-0c9da1808c22