Add lua extensions support for Mac OS X. Split into a commit for the supporting code, and a commit to add the extensions submenu to the gui. (apologies if this is a duplicate, I had some trouble sending these about two hours ago)