I'm currently developing modules that are intended to work on the main site and on Facebook and I'm wondering on fellow devs input before I continue this any further.
Essentially one big crux about Facebook development is
1) FB hates importing more than 16k in Javascript.
2) FB Sandboxes JS code and prefixes every variable/function with a random key.
3) I don't like iframes and want to use FBML.

This makes mootools unusable with facebook but I still like Mootools to work within the main site.

My solution has been to develop a common set of functions which talk to whichever Javascript library in use, ie:
Mootools for the main website.
FBJS for Facebook related pages.

I've defined a new variable in tl_layout that searches for .js files prefixed by 'tl_' and this is editable via the dca.
The naming of this new variable is fn_dispatch.

I'm still experimenting with this approach and going to see what results I get, does this sound good?