Revert "Remove unused functions."

This reverts commit 16ab4a1abb84c2ac43ebeb5eb248146981e29b1d.
Joining together functions new_object() and session_object_exists to improve performance.
Switch use of g_slist_append() for g_slist_prepend().

The aim is performance, the list does not need to be ordered.