Added bail-out routine if not configured.

Cleaned up formatting.
Added full PHP open tags.
Added not-configured bail-out check at the top.