Add recursion detection for @import

And a test