More work on Shape.

Added Shape.flatten to reduce complexity.
First pass at calculating getNaturalWidth() and getNaturalHeight().