Added length.

Calculations of types lengths and average lengths. Added len calc to
Document class.