prune unused functions and add unit tests for a number of the remaining ones. Signed-off-by: baude <bbaude@redhat.com>