Various cleanup + documentation addition.