Fix GPIO.  A large commit.
Fix weak references for Mac OS X