[Applications] Store a "refs"-Array in an application document

This is to speed up "by=jobs" list view to avoid multiple queries.
[Applications,Core] Refactor paginator adapter handling

Also adds ability for view scripts to add container to the sidebar.