Adding/removing child with null parent now uses root node as parent.
Code cleanup. Fixed null pointer error in EntityNode debug mode.

Change-Id: Iad0aad22919aed8ec89ff32543de863e5b4200d3
temp commit