Added debugging facilities in Entity and EntityTestCase to facilitate debugging issues.
- Added flag in BaseTestCase to toggle debug output
- Added flag in BaseTestCase to toggle between using SQLite in memory and on disk (useful for analysis)

Fixed an issue where upon node creation all the sibiling nodes would be improperly reordered.

Fixed entities being created multiple times when calling createFromArray().
The issue was that calling $children->toArray() would generate an array of values (recursively) which addChildren() thought were new nodes (instead of existing nodes).
The fix is to use $children->all() which returns an array of the Entity objects instead of an array of arrays.

Optimized a couple of function preventing useless calls to the database when we already have the Entity available.