bug fixes. clean up of portal xql files.
side note: the portal namespace has to be split into sub-namespaces, e.g.
portal, portal::element, portal::element::parameter, portal::layout,
portal::theme, etc. each should go into it's own file so that the code will be
easier to manage.