Cleanup, sync and documentation.

Sorry this is a large commit, I figured out I forgot to push regularly
in recent weeks:(