Nanocasting hierarchical carbide-derived carbons in nanostructured opal assemblies for high-performance cathodes in lithium-sulfur batteries.