8.0 project

Stefaan, here are some fixes that I found necessary to progress beyond the project module.

I'm not 100% sure about the changes on logged_query but it should fall through clean for most usage forms.