Big commit of a bunch of changes that have accumulated; I'll try to keep
it more up to date in the future