Settings fixes

Only load the admin settings tree when required.
This change is backwards compatible with moodle 1.9 but is required for Moodle 2.3 and should see a performance benefit for any admin users.