MDL-39152 webservices: Provide alternative to context id

As per our policy asking for and returning contextids is discouraged in webservices. So provide alternative parameters for the same
MDL-39152 phpunit: improve tests for assign_roles()

core_role_external::assign_roles() now support alternative paramaters instead of contextid. Test working of those. Also test the parameters validation a bit, since these are no longer automatically tested being optional now
MDL-39152 phpunit: Move core_role_external_testcase() to a new file

It is not recommended to have multiple test classes in a single phpunit file