Added popularity column to libraries table and changed most popular scope