Remove testEntities code (wasn't working properly anymore),
other minor cleanups.