support jobs inside folders

and better use jenkins API to avoid use of instanceof