mdl-34989 assign Allow students to submit when grade is overriden

Also inform teachers when grading is disabled due to gradebook lock/override.
MDL-40806 JavaScript: Add module metadata in JS dev modes
MDL-40727 Cache: Fix file cache store on windows.
MDL-40005: LTI module uses Apache specific function for retrieving request headers
MDL-11270 use NVARCHAR(MAX) and VARBINARY(MAX) in SQL Server
MDL-40867 fix misleading PHPdocs for _get_coursemodule_info
MDL-40854 fix mod/...:view capabilities

Prior to the fix, if you did not have a capability like mod/page:view,
then you woulds still see the link to the Page activity in the course
section, but when you clicked on it, you would run into a
require_capability error.

It is a principle that we never show users a link to a page they are not
allowed to access, therefore, when users do not have mod/...:view, they
should not see the link on the course page.

This patch implements this in the cm_info class, in a similar way to how
access restrictions by groups works.

It does not assume that the mod/...:view capability exists. If the
capability does not exist, then users are not prevented from seeing the
link.
MDL-40891 work around make_writable_directory() race condition

You will still get a "PHP Warning:  mkdir(): File exists" but that should not cause any problems on production sites.
MDL-40891 prevent exceptions when creating directories in file store

Even if cache creation fails moodle should continue working.
Merge branch 'MDL-40806-m' of git://github.com/andrewnicols/moodle
Merge branch 'MDL-40005_lti_headers' of git://github.com/moodlerooms/moodle
Merge branch 'MDL-40854' of git://github.com/timhunt/moodle
Merge branch 'MDL-40727-master' of git://github.com/damyon/moodle
Merge branch 'w31_MDL-40891_m26_mkdirrace' of https://github.com/skodak/moodle
Merge branch 'MDL-40878' of git://github.com/timhunt/moodle
Merge branch 'w31_MDL-11270_m26_nvarcharmax' of https://github.com/skodak/moodle
Merge branch 'MDL-34989_assign_grade_override_change' of https://github.com/ashleyholman/moodle into MDL-34989-master

Conflicts:
	mod/assign/locallib.php
MDL-34989: Fixed calls to setType for changed grade form element.