Fixes pages without Resources in their dictionary

Fix Issue #4461: Pages without \Resources in their dictionary fail to load

When no "\Resource" entry could be found return an empty dictionary

And when I am touching core.js anyway, also refactor and fix the style of `Page`