Added documentation to the c module.
Use setdefault() where appropriate.
Fixed some minor docs issues.