Language concepts for ports in boxes (no base language query anymore)

Also some small refactorings.