Improve performance of 'jsnx.helper.nested_chain'.

By avoiding recursive calls, the performance of functions using
'jsnx.helper.nested_chain', such as 'G.edges_iter' can be improved
greatly.