Added print_db function and beautified the log.
Merge pull request #12 from rickyholtz/popularity

Added print_db function and beautified the log. Changed the way popularity is tracked.