bug fix and new callable clearEntities

Fixed missing chaining in changeSource.
Added callable method clearEntities and refactored entity deletion from
DOM to be shared from callable delete and internal delete from click /
backspace.