APIv3: primary organization id should be derived if not set
APIv3: ensure that user's have logged in to the web interface when using a facebook token.
Merge remote-tracking branch 'origin/master'