Replacement of some deprecated code

Hi, 
This pull request aims to correct some inconsistencies detected in variable names and declaration, but mostly to update some deprecated code, accordingly to the new moodle standards, namely the  'get_context_.....' functions, that will be deprecated in Moodle 2.8, with context_xxxx:: , move_category --> coursecat::get($category->id)->change_parent($newparentcat->id) and mark_context_dirty($path) to $context->mark_dirty();

Greetings,
Micael Rodrgiues