Revamped to better detect project.

Before if we resolved a project that had another project inside its directory
tree, the nested project would never be properly identified. Now we always look
to the file system and our project finders to find the root of a project and
once we have that root, we check whether the project is already resolved.

Also fixed a niggle now that visitBuffer() takes a Buffer.