Author: Sam Hemelryk
MDL-25394 Tidied up several things in order to get this integrated
http://git.moodle.org/gw?p=moodle.git;a=commit;h=e5824bb9c64272c98f52db6efcda7dcc836761e1
http://github.com/moodle/moodle/commit/e5824bb9c64272c98f52db6efcda7dcc836761e1
+ 2.1dev en [invaliddevicetype,core_error]