Dramatically improved content upgrade performance by caching libraries.
Added real async function to avoid using up the stack.