In reply to Nick Haskins.

That asynchronous code for Facebook apps (or for stats/Google tracking/etc.) absolutely belongs in a Plugin. I can't think of a valid argument for having it in the Theme.