fixed type predicates for heap objects
added a basic test suite
added more tests