Lots of changed and cleanup. Includes a way to handle implicit shapes.