tmf: Added documentation and refactoring to the merge method

Change-Id: I764291e0ca5281550a16d61a9aa8dbf5ca05d390
Signed-off-by: Mathieu Rail <contact@mathieurail.com>
Signed-off-by: Mathieu Rail <contact@mathieurail.com>