Changed software architecture for shapes

Part of making the API easier to use.
Examples update comming in next commit.