check if pid is in the returned fields before trying to use it
make pids available to theme layer without intefering with results. Also make first field a link
clean up
Merge pull request #96 from nhart/6.x

check if pid is in the returned fields before trying to use it