Move checkMaintenance and checkUpgrade

This is needed to ensure that the routing and linkTo() function for CSP
are available.
Move update inline JS
Merge branch 'master' into updater-CSP

Conflicts:
	core/templates/update.php
Merge pull request #1313 from owncloud/updater-CSP

Make update page with CSP compatible