Largely rewritten docs, fixes, etc.