Add OpenGraph support

Adds $wgTwitterCardsPreferOG to control using OpenGraph fallbacks
whenever possible (<https://dev.twitter.com/docs/cards/markup-
reference>).

For code clarity, the hook function was moved into its own file.

Change-Id: I585e8ee78007f7c5854fd06dbcfabd02271f6ab4