Test with import at BEGIN-time

and move the attribute handler execution at BEGIN-time too.