split off the generic part of the lib...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
several minor updates and migrations...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>