Messy major update, long overdue.

This commit will be abandoned when we switch to ding2tal.