Refactor existing code, and harmonize interface. Add a couple of tests. Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>