Move to glib data structures, refactor user storage