Backport compat folder to Joomla 2.5

Pull request made for @jms2win and is related to #3688 and #3691.

@jms2win: Please add your comments for the use of this pull request and create a Joomlacode tracker. Thanks.