[TASK] Cleanup resulting in performance improvement

This cleans up some unused variables, switches some semi-duplicated code over to new API methods and implements an additional cache when reading configurations directly from Flux template files - resulting in big performance improvements especially on large page trees.