Port request helper functions from bbPress, to be used as part of rewrite rules integration in a future release.

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