Simplify the Shape API + implementation and MapperTest

testWideMappedEntity is much simpler now with the new table definitions
based on ProvenShape and it can do proper bidirectional mappings.

EncodeRef and NodeGenerator are no longer necessary. The only relevant
implementations (that actually need to go through the traits for that
functionality) are in Rep classes. We can safely place the methods
encodeRef and toNode directly into Rep.