libraries: more refactoring; basic UI based on role handling; attaching to global Galaxy object; persistent lib preferences