Fix Issue #4461: Pages without \Resources in their dictionary fail to load

When no "\Resource" entry could be found return an empty dictionary
Refactor and fix style of core.js
Add load test for Issue #4461
Merge pull request #4464 from bthorben/issue#4461

Fixes pages without Resources in their dictionary