Improving the preload handling.
Fix for the loading state check.
Merge branch 'master' into gh-pages

Conflicts:
	scripts/app/main.js