Topology of folded molecular chains: from single biomolecules to engineered origami