I am looking for a macro that would take a string (better to say -- a sequence of words) and output the last word at the fist place before remaning part of the sequence. I want to put this macro into the definition of an environment intended to typeset personal information for a person:
\newenvironment{person}[2]%
{% begin definition
\section*{#2}\label{#1}
\addcontentsline{toc}{section}{#2}
}{% end definition
\clearpage
}
So that instead of
\addcontentsline{toc}{section}{#2}
there should be
\addcontentsline{toc}{section}{\reverseit{#2}}
The \reverseit macro should produce Alfv\'{e}n Hannes from Hannes Alfv\'{e}n and Allen James van from James van Allen. It should also handle exceptional case when its argument consist of a single word (eg, Aristotle).
Is is possible to compose such a macro within framework of TeX or, say, using Lua or LaTeX3?
A receipt proposed as an answert to How can I reverse the order of letters/tokens? solves my problem only in the case of a sequence which consists of two words.

Alfv\'{e}nshould be expanded of not. – Igor Kotelnikov Jan 04 '13 at 14:11