@jzvelc, thanks for pointing me that part of the spec. This time around I read it more carefully than when it first came out.
What it really means is that if a file imports an external module, it will become itself an external module (and thus will be loaded in a separate body). So that would explains the compiler errors I got. So not a bug, but the intended behavior.
I get more and more the feeling that the current module approach of TS is not optimal. I hope it will get revised so it becomes much more "natural" to use and you don't have to fight it all the time.