MDL-45843 mod_lti: Moved ltiservice class

ltiservice class moved into local
MDL-45843 mod_lti: Replaced lti_scale_used comments

Put back commented out code for lti_scale_used
MDL-45843 mod_lti: Removed redundant sesskey code

Removed redundant required_param('sesskey', PARAM_RAW) statements
MDL-45843 mod_lti: Fixed namespace and path check

Updated ltiservice namespace for move into local
Added check for existence of $_SERVER['PATH_INFO']
MDL-45843 mod_lti: Updated upgrade code

Added indices and keys to lti_tool_settings table when upgrading
Fixed errors in upgradelib_test.php (thanks to jleyva)
Update SQL to use Moodle functions