Tried to get rid of most global variables in librarian, and added configuration checks.
Moved Library class in dedicated file in librarianlib.