ensures that users passed to the rest of the module code are actually moodle users
merge changes in lib.php
imports global  to quell phpunit crash
moves user generation into separate file in order to afford more granular control and deliberate resuse of the known user
adds test for changes introduced in c8f1f9fba79bb4