Wraps any function/module/object/lib within an AMD-compliant definition if possible, otherwise binding to `window`