Fixed Facebook application-based authorization when multiple URL schemes are registered.

This also adds tests to application-based authorization detection for
Facebook and simplifies the workflow a bit.