Added a setType method to BaseEntity.  Add null checking to TupleStores.  Fixes #90.