Put external declarations at the top.

This is necessary in some cases, eg. namespace declarations.