Cookbook: pivot tables. Closes #41.