Adding logging, tightening up docs.