Various coding style fixes and documentation.