Revert "Fix aliasing recursion with with-profile"

This reverts commit 0334cc8efa5b790b810317e08c568ae8e424041e.
with-project returns values for all profile groups

with-profile was discarding return values for the result of each profile
group application.
Factor out default-project

Pulls the default project used when not in a directory into a separate
function, so it can be used in tests.
Add tests for with-profile
Revert "Grant non-project profile access to with-profile"

This reverts commit 3a2cf943243a6bba44294fca741a9e55429127e9.
Merge pull request #1696 from hugoduncan/fix-profiles-on-aliases

Fix with-profile alias changes