add a check for jui to avoid inclusion twice. It causes ugly bugs
Early init of PageManager helps us detect URLs of resources easier