More class/struct mixup fixes.Spotted by Clang.
Mail: Fix gcc4 build.- Fix typo in forward declaration.- Add missing include for snprintf.- Add missing virtual destructor on QueryListener abstract class.
Mail: work in progress to use the layout API.