Fixed code related to library functions

The "Include in Library" menu in Home > Easy Access now works again. Also, the Libraries contextual tab now correctly displays information when a library is selected. Also cleaned up some code.