Add conditional aq_base attribute query
Add explicit attribute test

Use hasattr to check wether the context has a stored layout and return
the corresponding empty list if not