Compatibility with Silverstripe 3.1

Updated HomepageForDomainExtension.php to make it work with Silverstripe 3.1
Should work with Silverstripe 3.0, not tested though.

Cheers,
M