Purify the library; add vote totals

(Instead of printing a table, return a string.)