UoN changes

Hi Mark,

Those changes as promised.

Essentially just the fixes for the deprecation of get_context_instance and some other minor fixes.

Did some Moodle coding standard changes whilst I was at it as well.

Joe